final PayloadImpl.Inbound inboundPayload = PayloadImpl.Inbound.newInstance( "application/zip", payloadInputStream);
.newInstance(req.getContentType(), req.getInputStream()); if (aalogger.isLoggable(Level.FINE)) { aalogger.log(Level.FINE, "***** AdminAdapter {0} *****", req.getMethod());
final PayloadImpl.Inbound inboundPayload = PayloadImpl.Inbound.newInstance( "application/zip", payloadInputStream);
try { in = new FileInputStream(syncBundle); payload = PayloadImpl.Inbound.newInstance("application/zip", in); } catch (IOException ex) { try {
logger.finer("Response Content-Type: " + responseContentType); Payload.Inbound inboundPayload = PayloadImpl.Inbound.newInstance(responseContentType, in);
logger.finer("Response Content-Type: " + responseContentType); Payload.Inbound inboundPayload = PayloadImpl.Inbound.newInstance(responseContentType, in);
@Override public void useConnection(final HttpURLConnection urlConnection) throws CommandException, IOException { InputStream in = urlConnection.getInputStream(); String responseContentType = urlConnection.getContentType(); Payload.Inbound inboundPayload = PayloadImpl.Inbound.newInstance(responseContentType, in); if (inboundPayload == null) throw new IOException( strings.get("NoPayloadSupport", responseContentType)); PayloadFilesManager downloadedFilesMgr = new PayloadFilesManager.Perm(fileOutputDir, null, logger, new PayloadFilesManager.ActionReportHandler() { @Override public void handleReport(InputStream reportStream) throws Exception { handleResponse(options, reportStream, urlConnection.getResponseCode(), userOut); } }); try { downloadedFilesMgr.processParts(inboundPayload); } catch (CommandException cex) { throw cex; } catch (Exception ex) { throw new CommandException(ex.getMessage(), ex); } } });
@Override public void useConnection(final HttpURLConnection urlConnection) throws CommandException, IOException { InputStream in = urlConnection.getInputStream(); String responseContentType = urlConnection.getContentType(); Payload.Inbound inboundPayload = PayloadImpl.Inbound.newInstance(responseContentType, in); if (inboundPayload == null) throw new IOException( strings.get("NoPayloadSupport", responseContentType)); PayloadFilesManager downloadedFilesMgr = new PayloadFilesManager.Perm(fileOutputDir, null, logger, new PayloadFilesManager.ActionReportHandler() { @Override public void handleReport(InputStream reportStream) throws Exception { handleResponse(options, reportStream, urlConnection.getResponseCode(), userOut); } }); try { downloadedFilesMgr.processParts(inboundPayload); } catch (CommandException cex) { throw cex; } catch (Exception ex) { throw new CommandException(ex.getMessage(), ex); } } });
private Inbound loadInbound(File inboundFile) throws IOException { if (inboundFile == null || !inboundFile.exists()) { return null; } FileInputStream is = new FileInputStream(inboundFile); Inbound inboundSource = PayloadImpl.Inbound.newInstance("application/zip", is); return inboundSource; }