public void hold(Message message) throws IOException { cache(message); cache.holdTempFile(); } public void release() {
public void handleMessage(Message message) throws Fault { Collection<AttachmentDataSource> dss = CastUtils.cast((List<?>)message.get(SAVED_DATASOURCES)); for (AttachmentDataSource ds : dss) { ds.release(); } } }
private void cacheStreamedAttachments() throws IOException { if (body instanceof DelegatingInputStream && !((DelegatingInputStream) body).isClosed()) { cache((DelegatingInputStream) body); } List<Attachment> atts = new ArrayList<>(attachments.getLoadedAttachments()); for (Attachment a : atts) { DataSource s = a.getDataHandler().getDataSource(); if (s instanceof AttachmentDataSource) { AttachmentDataSource ads = (AttachmentDataSource)s; if (!ads.isCached()) { ads.cache(message); } } else if (s.getInputStream() instanceof DelegatingInputStream) { cache((DelegatingInputStream) s.getInputStream()); } else { //assume a normal stream that is already cached } } }
headers.remove("Content-Transfer-Encoding"); DataSource source = new AttachmentDataSource(ct, ins); if (!StringUtils.isEmpty(fileName)) { ((AttachmentDataSource)source).setName(fileName);
attachmentResultCallback.getAttachmentId(), new DataHandler( new AttachmentDataSource( attachmentResultCallback.getAttachment().getMimeType(), attachmentResultCallback.getAttachment().getSourceStream())
public void handleMessage(Message message) throws Fault { // This assumes that this interceptor is only use in IN / IN Fault chains. if (ServiceUtils.isSchemaValidationEnabled(SchemaValidationType.IN, message) && message.getAttachments() != null) { Collection<AttachmentDataSource> dss = new ArrayList<>(); for (Attachment at : message.getAttachments()) { if (at.getDataHandler().getDataSource() instanceof AttachmentDataSource) { AttachmentDataSource ds = (AttachmentDataSource)at.getDataHandler().getDataSource(); try { ds.hold(message); } catch (IOException e) { throw new Fault(e); } dss.add(ds); } } if (!dss.isEmpty()) { message.put(SAVED_DATASOURCES, dss); message.getInterceptorChain().add(EndingInterceptor.INSTANCE); } } }
private void cacheStreamedAttachments() throws IOException { if (body instanceof DelegatingInputStream && !((DelegatingInputStream) body).isClosed()) { cache((DelegatingInputStream) body, true); } List<Attachment> atts = new ArrayList<Attachment>(attachments.getLoadedAttachments()); for (Attachment a : atts) { DataSource s = a.getDataHandler().getDataSource(); if (s instanceof AttachmentDataSource) { AttachmentDataSource ads = (AttachmentDataSource)s; if (!ads.isCached()) { ads.cache(message); } } else if (s.getInputStream() instanceof DelegatingInputStream) { cache((DelegatingInputStream) s.getInputStream(), false); } else { //assume a normal stream that is already cached } } }
headers.remove("Content-Transfer-Encoding"); DataSource source = new AttachmentDataSource(ct, ins); if (!StringUtils.isEmpty(fileName)) { ((AttachmentDataSource)source).setName(fileName);
attachmentResultCallback.getAttachmentId(), new DataHandler( new AttachmentDataSource( attachmentResultCallback.getAttachment().getMimeType(), attachmentResultCallback.getAttachment().getSourceStream())
private void cacheStreamedAttachments() throws IOException { if (body instanceof DelegatingInputStream && !((DelegatingInputStream) body).isClosed()) { cache((DelegatingInputStream) body, true); } List<Attachment> atts = new ArrayList<Attachment>(attachments.getLoadedAttachments()); for (Attachment a : atts) { DataSource s = a.getDataHandler().getDataSource(); if (s instanceof AttachmentDataSource) { AttachmentDataSource ads = (AttachmentDataSource)s; if (!ads.isCached()) { ads.cache(message); } } else if (s.getInputStream() instanceof DelegatingInputStream) { cache((DelegatingInputStream) s.getInputStream(), false); } else { //assume a normal stream that is already cached } } }
public void hold(Message message) throws IOException { cache(message); cache.holdTempFile(); } public void release() {
DataSource source = new AttachmentDataSource(ct, new QuotedPrintableDecoderStream(stream)); if (!StringUtils.isEmpty(fileName)) { ((AttachmentDataSource)source).setName(fileName); DataSource source = new AttachmentDataSource(ct, stream); if (!StringUtils.isEmpty(fileName)) { ((AttachmentDataSource)source).setName(fileName);
private void cacheStreamedAttachments() throws IOException { if (body instanceof DelegatingInputStream && !((DelegatingInputStream) body).isClosed()) { cache((DelegatingInputStream) body); } List<Attachment> atts = new ArrayList<>(attachments.getLoadedAttachments()); for (Attachment a : atts) { DataSource s = a.getDataHandler().getDataSource(); if (s instanceof AttachmentDataSource) { AttachmentDataSource ads = (AttachmentDataSource)s; if (!ads.isCached()) { ads.cache(message); } } else if (s.getInputStream() instanceof DelegatingInputStream) { cache((DelegatingInputStream) s.getInputStream()); } else { //assume a normal stream that is already cached } } }
public void hold(Message message) throws IOException { cache(message); cache.holdTempFile(); } public void release() {
DataSource source = new AttachmentDataSource(ct, new QuotedPrintableDecoderStream(stream)); if (!StringUtils.isEmpty(fileName)) { ((AttachmentDataSource)source).setName(fileName); DataSource source = new AttachmentDataSource(ct, stream); if (!StringUtils.isEmpty(fileName)) { ((AttachmentDataSource)source).setName(fileName);
public void hold(Message message) throws IOException { cache(message); cache.holdTempFile(); } public void release() {
if (a.getDataHandler().getDataSource() instanceof AttachmentDataSource) { try { ((AttachmentDataSource)a.getDataHandler().getDataSource()).cache(inMessage); } catch (IOException e) { throw new Fault(e);
if (a.getDataHandler().getDataSource() instanceof AttachmentDataSource) { try { ((AttachmentDataSource)a.getDataHandler().getDataSource()).cache(inMessage); } catch (IOException e) { throw new Fault(e);
if (a.getDataHandler().getDataSource() instanceof AttachmentDataSource) { try { ((AttachmentDataSource)a.getDataHandler().getDataSource()).cache(inMessage); } catch (IOException e) { throw new Fault(e);
if (a.getDataHandler().getDataSource() instanceof AttachmentDataSource) { try { ((AttachmentDataSource)a.getDataHandler().getDataSource()).cache(message); } catch (IOException e) { throw new Fault(e);