Examples of SwapableMemoryDataSource


Examples of org.jboss.ws.core.soap.attachment.SwapableMemoryDataSource

               try
               {
                  String contentType = MimeUtils.resolveMimeType(javaType);
                  log.debug("Adopt DataHandler to " + javaType + ", contentType " + contentType);

                  DataSource ds = new SwapableMemoryDataSource(((DataHandler)obj).getInputStream(), contentType);
                  DataHandler dh = new DataHandler(ds);
                  obj = dh.getContent();

                  // 'application/octet-stream' will return a byte[] instead fo the stream
                  if (obj instanceof InputStream)
View Full Code Here

Examples of org.jboss.ws.core.soap.attachment.SwapableMemoryDataSource

               try
               {
                  String contentType = MimeUtils.resolveMimeType(javaType);
                  log.debug("Adopt DataHandler to " + javaType + ", contentType " + contentType);

                  DataSource ds = new SwapableMemoryDataSource(((DataHandler)obj).getInputStream(), contentType);
                  DataHandler dh = new DataHandler(ds);
                  obj = dh.getContent();

                  // 'application/octet-stream' will return a byte[] instead fo the stream
                  if (obj instanceof InputStream)
View Full Code Here

Examples of org.jboss.ws.core.soap.attachment.SwapableMemoryDataSource

      DataSource ds;

      if(object instanceof byte[])
      {
         ds = new SwapableMemoryDataSource(new ByteArrayInputStream((byte[])object), contentType);
      }
      else if(object instanceof DataHandler)
      {
         ds = new SwapableMemoryDataSource(((DataHandler)object).getInputStream(), contentType);
      }
      else
      {
         throw new IllegalArgumentException("Failed to wrap as data source: "+object.getClass());
      }
View Full Code Here

Examples of org.jboss.ws.core.soap.attachment.SwapableMemoryDataSource

               try
               {
                  String contentType = MimeUtils.resolveMimeType(javaType);
                  log.debug("Adopt DataHandler to " + javaType + ", contentType " + contentType);

                  DataSource ds = new SwapableMemoryDataSource(((DataHandler)obj).getInputStream(), contentType);
                  DataHandler dh = new DataHandler(ds);
                  obj = dh.getContent();

                  // 'application/octet-stream' will return a byte[] instead fo the stream
                  if (obj instanceof InputStream)
View Full Code Here

Examples of org.jboss.ws.core.soap.attachment.SwapableMemoryDataSource

            AttachmentPart attachment = (AttachmentPart)it.next();
            try
            {
               if(attachment.getDataHandler().getDataSource() instanceof SwapableMemoryDataSource)
               {
                  SwapableMemoryDataSource swapFile = (SwapableMemoryDataSource)attachment.getDataHandler().getDataSource();
                  swapFile.cleanup();
               }
            }
            catch (SOAPException e)
            {
               log.warn("Failed to cleanup attachment part", e);
View Full Code Here

Examples of org.jboss.ws.core.soap.attachment.SwapableMemoryDataSource

               try
               {
                  String contentType = MimeUtils.resolveMimeType(javaType);
                  log.debug("Adopt DataHandler to " + javaType + ", contentType " + contentType);

                  DataSource ds = new SwapableMemoryDataSource(((DataHandler)obj).getInputStream(), contentType);
                  DataHandler dh = new DataHandler(ds);
                  obj = dh.getContent();

                  // 'application/octet-stream' will return a byte[] instead fo the stream
                  if (obj instanceof InputStream)
View Full Code Here

Examples of org.jboss.ws.core.soap.attachment.SwapableMemoryDataSource

            AttachmentPart attachment = (AttachmentPart)it.next();
            try
            {
               if(attachment.getDataHandler().getDataSource() instanceof SwapableMemoryDataSource)
               {
                  SwapableMemoryDataSource swapFile = (SwapableMemoryDataSource)attachment.getDataHandler().getDataSource();
                  swapFile.cleanup();
               }
            }
            catch (SOAPException e)
            {
               log.warn("Failed to cleanup attachment part", e);
View Full Code Here

Examples of org.jboss.ws.core.soap.attachment.SwapableMemoryDataSource

      DataSource ds;

      if(object instanceof byte[])
      {
         ds = new SwapableMemoryDataSource(new ByteArrayInputStream((byte[])object), contentType);
      }
      else if(object instanceof DataHandler)
      {
         ds = new SwapableMemoryDataSource(((DataHandler)object).getInputStream(), contentType);
      }
      else
      {
         throw new IllegalArgumentException("Failed to wrap as data source: "+object.getClass());
      }
View Full Code Here

Examples of org.jboss.ws.core.soap.attachment.SwapableMemoryDataSource

            AttachmentPart attachment = (AttachmentPart)it.next();
            try
            {
               if(attachment.getDataHandler().getDataSource() instanceof SwapableMemoryDataSource)
               {
                  SwapableMemoryDataSource swapFile = (SwapableMemoryDataSource)attachment.getDataHandler().getDataSource();
                  swapFile.cleanup();
               }
            }
            catch (SOAPException e)
            {
               log.warn("Failed to cleanup attachment part", e);
View Full Code Here

Examples of org.jboss.ws.core.soap.attachment.SwapableMemoryDataSource

/*     */           try
/*     */           {
/* 221 */             String contentType = MimeUtils.resolveMimeType(javaType);
/* 222 */             log.debug("Adopt DataHandler to " + javaType + ", contentType " + contentType);
/*     */
/* 224 */             DataSource ds = new SwapableMemoryDataSource(((DataHandler)obj).getInputStream(), contentType);
/* 225 */             DataHandler dh = new DataHandler(ds);
/* 226 */             obj = dh.getContent();
/*     */
/* 229 */             if ((obj instanceof InputStream))
/*     */             {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.