ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1797605 - in /webservices/axiom/trunk: aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/intf/ axiom-api/ axiom-api/src/main/java/org/apache/axiom/om/ds/jaxb/ testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelem...
Date Sun, 04 Jun 2017 19:23:11 GMT
Author: veithen
Date: Sun Jun  4 19:23:11 2017
New Revision: 1797605

URL: http://svn.apache.org/viewvc?rev=1797605&view=rev
Log:
Use BlobDataSource instead of ByteArrayDataSource.

Modified:
    webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/intf/TextContent.java
    webservices/axiom/trunk/axiom-api/pom.xml
    webservices/axiom/trunk/axiom-api/src/main/java/org/apache/axiom/om/ds/jaxb/AttachmentMarshallerImpl.java
    webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/TestGetObject.java

Modified: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/intf/TextContent.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/intf/TextContent.java?rev=1797605&r1=1797604&r2=1797605&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/intf/TextContent.java
(original)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/intf/TextContent.java
Sun Jun  4 19:23:11 2017
@@ -22,7 +22,8 @@ import java.io.IOException;
 
 import javax.activation.DataHandler;
 
-import org.apache.axiom.attachments.ByteArrayDataSource;
+import org.apache.axiom.blob.BlobDataSource;
+import org.apache.axiom.blob.Blobs;
 import org.apache.axiom.core.ClonePolicy;
 import org.apache.axiom.core.CloneableCharacterData;
 import org.apache.axiom.core.stream.CharacterData;
@@ -127,7 +128,7 @@ public final class TextContent implement
             }
             return (DataHandler)dataHandlerObject;
         } else if (binary) {
-            return new DataHandler(new ByteArrayDataSource(Base64Utils.decode(value), mimeType));
+            return new DataHandler(new BlobDataSource(Blobs.createBlob(Base64Utils.decode(value)),
mimeType));
         } else {
             throw new OMException("No DataHandler available");
         }

Modified: webservices/axiom/trunk/axiom-api/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/axiom-api/pom.xml?rev=1797605&r1=1797604&r2=1797605&view=diff
==============================================================================
--- webservices/axiom/trunk/axiom-api/pom.xml (original)
+++ webservices/axiom/trunk/axiom-api/pom.xml Sun Jun  4 19:23:11 2017
@@ -306,7 +306,6 @@
                                 org.apache.axiom.attachments.lifecycle.LifecycleManager ->
org.apache.axiom.attachments.lifecycle.impl.FileAccessor,
                                 <!-- TODO -->
                                 org.apache.axiom.om.impl.OMMultipartWriter -> org.apache.axiom.attachments.ConfigurableDataHandler,
-                                org.apache.axiom.om.ds.jaxb.AttachmentMarshallerImpl ->
org.apache.axiom.attachments.ByteArrayDataSource,
                                 <!-- o.a.a.soap should be a layer on top of o.a.a.om -->
                                 org.apache.axiom.om.OMAbstractFactory -> org.apache.axiom.soap.SOAPFactory,
                                 org.apache.axiom.om.OMMetaFactory -> org.apache.axiom.soap.SOAPFactory,

Modified: webservices/axiom/trunk/axiom-api/src/main/java/org/apache/axiom/om/ds/jaxb/AttachmentMarshallerImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/axiom-api/src/main/java/org/apache/axiom/om/ds/jaxb/AttachmentMarshallerImpl.java?rev=1797605&r1=1797604&r2=1797605&view=diff
==============================================================================
--- webservices/axiom/trunk/axiom-api/src/main/java/org/apache/axiom/om/ds/jaxb/AttachmentMarshallerImpl.java
(original)
+++ webservices/axiom/trunk/axiom-api/src/main/java/org/apache/axiom/om/ds/jaxb/AttachmentMarshallerImpl.java
Sun Jun  4 19:23:11 2017
@@ -21,7 +21,8 @@ package org.apache.axiom.om.ds.jaxb;
 import javax.activation.DataHandler;
 import javax.xml.bind.attachment.AttachmentMarshaller;
 
-import org.apache.axiom.attachments.ByteArrayDataSource;
+import org.apache.axiom.blob.BlobDataSource;
+import org.apache.axiom.blob.Blobs;
 import org.apache.axiom.om.impl.MTOMXMLStreamWriter;
 
 final class AttachmentMarshallerImpl extends AttachmentMarshaller {
@@ -52,7 +53,7 @@ final class AttachmentMarshallerImpl ext
             System.arraycopy(data, offset, newData, 0, len);
             data = newData;
         }
-        return addMtomAttachment(new DataHandler(new ByteArrayDataSource(data, "application/octet-stream")),
+        return addMtomAttachment(new DataHandler(new BlobDataSource(Blobs.createBlob(data),
"application/octet-stream")),
                 elementNamespace, elementLocalName);
     }
 

Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/TestGetObject.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/TestGetObject.java?rev=1797605&r1=1797604&r2=1797605&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/TestGetObject.java
(original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/TestGetObject.java
Sun Jun  4 19:23:11 2017
@@ -23,7 +23,8 @@ import java.nio.charset.Charset;
 import javax.activation.DataSource;
 import javax.xml.namespace.QName;
 
-import org.apache.axiom.attachments.ByteArrayDataSource;
+import org.apache.axiom.blob.BlobDataSource;
+import org.apache.axiom.blob.Blobs;
 import org.apache.axiom.om.OMFactory;
 import org.apache.axiom.om.OMMetaFactory;
 import org.apache.axiom.om.OMSourcedElement;
@@ -40,7 +41,7 @@ public class TestGetObject extends Axiom
     @Override
     protected void runTest() throws Throwable {
         OMFactory factory = metaFactory.getOMFactory();
-        DataSource ds = new ByteArrayDataSource("test".getBytes("utf-8"), "text/plain; charset=utf-8");
+        DataSource ds = new BlobDataSource(Blobs.createBlob("test".getBytes("utf-8")), "text/plain;
charset=utf-8");
         OMSourcedElement element = factory.createOMElement(new WrappedTextNodeOMDataSourceFromDataSource(new
QName("wrapper"), ds, Charset.forName("utf-8")));
         // getObject returns null if the data source is not of the expected type
         assertNull(element.getObject(StringOMDataSource.class));



Mime
View raw message