pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1843688 - /pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/utils/ByteArrayDataSource.java
Date Fri, 12 Oct 2018 16:36:30 GMT
Author: tilman
Date: Fri Oct 12 16:36:30 2018
New Revision: 1843688

URL: http://svn.apache.org/viewvc?rev=1843688&view=rev
Log:
PDFBOX-4340: replace DataSource from java activation framework with reduced implementation

Modified:
    pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/utils/ByteArrayDataSource.java

Modified: pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/utils/ByteArrayDataSource.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/utils/ByteArrayDataSource.java?rev=1843688&r1=1843687&r2=1843688&view=diff
==============================================================================
--- pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/utils/ByteArrayDataSource.java
(original)
+++ pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/utils/ByteArrayDataSource.java
Fri Oct 12 16:36:30 2018
@@ -25,17 +25,13 @@ import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
-import java.io.OutputStream;
-
-import javax.activation.DataSource;
 
 import org.apache.pdfbox.io.IOUtils;
 
 public class ByteArrayDataSource implements DataSource
 {
-    private ByteArrayOutputStream data;
-    private String type = null;
-    private String name = null;
+    private final ByteArrayOutputStream data;
+    private final String name = null;
 
     public ByteArrayDataSource(InputStream is) throws IOException
     {
@@ -44,42 +40,15 @@ public class ByteArrayDataSource impleme
         IOUtils.closeQuietly(is);
     }
 
-    public String getContentType()
-    {
-        return this.type;
-    }
-
-    /**
-     * @param type
-     *            the type to set
-     */
-    public void setType(String type)
-    {
-        this.type = type;
-    }
-
-    /**
-     * @param name
-     *            the name to set
-     */
-    public void setName(String name)
-    {
-        this.name = name;
-    }
-
+    @Override
     public InputStream getInputStream() throws IOException
     {
         return new ByteArrayInputStream(data.toByteArray());
     }
 
+    @Override
     public String getName()
     {
         return this.name;
     }
-
-    public OutputStream getOutputStream() throws IOException
-    {
-        this.data = new ByteArrayOutputStream();
-        return data;
-    }
 }



Mime
View raw message