@Override public void write(OutputStream outputStream) throws IOException, WebApplicationException { HttpOutput output = (HttpOutput) peer.getCommunicationsSession().getOutput(); output.setOutputStream(outputStream); try { int numOfFlowFiles = serverProtocol.getPort().transferFlowFiles(peer, serverProtocol); logger.debug("finished transferring flow files, numOfFlowFiles={}", numOfFlowFiles); if (numOfFlowFiles < 1) { // There was no flow file to transfer. Throw this exception to stop responding with SEE OTHER. throw new WebApplicationException(Response.Status.OK); } } catch (NotAuthorizedException | BadRequestException | RequestExpiredException e) { // Handshake is done outside of write() method, so these exception wouldn't be thrown. throw new IOException("Failed to process the request.", e); } }
case RECEIVE_FLOWFILES: protocol.getPort().transferFlowFiles(peer, protocol); break; case SEND_FLOWFILES:
case RECEIVE_FLOWFILES: protocol.getPort().transferFlowFiles(peer, protocol); break; case SEND_FLOWFILES: