You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by ve...@apache.org on 2011/08/11 20:32:05 UTC
svn commit: r1156718 - in
/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments:
./ impl/
Author: veithen
Date: Thu Aug 11 18:32:04 2011
New Revision: 1156718
URL: http://svn.apache.org/viewvc?rev=1156718&view=rev
Log:
Moved a couple of classes from org.apache.axiom.attachments to org.apache.axiom.attachments.impl so that we can reduce visibility from public to package.
Added:
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/ContentOnFile.java
- copied, changed from r1154710, webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/impl/ContentOnFile.java
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/ContentOnMemory.java
- copied, changed from r1154710, webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/impl/ContentOnMemory.java
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/ContentStore.java
- copied, changed from r1154710, webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/impl/ContentStore.java
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/ContentStoreFactory.java
- copied, changed from r1154682, webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/impl/ContentStoreFactory.java
Removed:
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/impl/ContentOnFile.java
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/impl/ContentOnMemory.java
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/impl/ContentStore.java
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/impl/ContentStoreFactory.java
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/MIMEMessage.java
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/Part.java
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/PartImpl.java
Copied: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/ContentOnFile.java (from r1154710, webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/impl/ContentOnFile.java)
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/ContentOnFile.java?p2=webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/ContentOnFile.java&p1=webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/impl/ContentOnFile.java&r1=1154710&r2=1156718&rev=1156718&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/impl/ContentOnFile.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/ContentOnFile.java Thu Aug 11 18:32:04 2011
@@ -17,9 +17,9 @@
* under the License.
*/
-package org.apache.axiom.attachments.impl;
+package org.apache.axiom.attachments;
-import org.apache.axiom.attachments.CachedFileDataSource;
+import org.apache.axiom.attachments.impl.BufferUtils;
import org.apache.axiom.attachments.lifecycle.LifecycleManager;
import org.apache.axiom.attachments.lifecycle.impl.FileAccessor;
@@ -37,7 +37,7 @@ import java.io.OutputStream;
* The PartOnFile object is created by the PartFactory
* @see ContentStoreFactory
*/
-public class ContentOnFile extends ContentStore {
+class ContentOnFile extends ContentStore {
FileAccessor fileAccessor;
LifecycleManager manager;
@@ -62,7 +62,7 @@ public class ContentOnFile extends Conte
}
- public InputStream getInputStream() throws IOException {
+ InputStream getInputStream() throws IOException {
try {
return fileAccessor.getInputStream();
} catch (MessagingException ex) {
@@ -74,7 +74,7 @@ public class ContentOnFile extends Conte
}
}
- public DataSource getDataSource(String contentType) {
+ DataSource getDataSource(String contentType) {
// The attachment cleanup code in Axis2 relies on the assumption that we
// produce a CachedFileDataSource here.
CachedFileDataSource ds = new CachedFileDataSource(fileAccessor.getFile());
@@ -82,7 +82,7 @@ public class ContentOnFile extends Conte
return ds;
}
- public void writeTo(OutputStream out) throws IOException {
+ void writeTo(OutputStream out) throws IOException {
InputStream in = getInputStream();
try {
BufferUtils.inputStream2OutputStream(in, out);
@@ -94,11 +94,11 @@ public class ContentOnFile extends Conte
/* (non-Javadoc)
* @see org.apache.axiom.attachments.impl.AbstractPart#getSize()
*/
- public long getSize() {
+ long getSize() {
return fileAccessor.getSize();
}
- public void destroy() throws IOException {
+ void destroy() throws IOException {
manager.delete(fileAccessor.getFile());
// TODO: recover the shutdown hook code from DataHandlerExtImpl
}
Copied: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/ContentOnMemory.java (from r1154710, webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/impl/ContentOnMemory.java)
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/ContentOnMemory.java?p2=webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/ContentOnMemory.java&p1=webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/impl/ContentOnMemory.java&r1=1154710&r2=1156718&rev=1156718&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/impl/ContentOnMemory.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/ContentOnMemory.java Thu Aug 11 18:32:04 2011
@@ -17,7 +17,7 @@
* under the License.
*/
-package org.apache.axiom.attachments.impl;
+package org.apache.axiom.attachments;
import org.apache.axiom.attachments.utils.BAAInputStream;
@@ -36,7 +36,7 @@ import javax.activation.DataSource;
* The PartOnMemoryEnhanced object is created by the PartFactory
* @see ContentStoreFactory
*/
-public class ContentOnMemory extends ContentStore {
+class ContentOnMemory extends ContentStore {
ArrayList data; // Arrays of 4K buffers
int length; // total length of data
@@ -51,24 +51,24 @@ public class ContentOnMemory extends Con
this.length = length;
}
- public InputStream getInputStream() {
+ InputStream getInputStream() {
return new BAAInputStream(data, length);
}
- public DataSource getDataSource(String contentType) {
+ DataSource getDataSource(String contentType) {
// Use a default implementation
return null;
}
- public void writeTo(OutputStream os) throws IOException {
+ void writeTo(OutputStream os) throws IOException {
new BAAInputStream(data, length).writeTo(os);
}
- public long getSize() {
+ long getSize() {
return length;
}
- public void destroy() throws IOException {
+ void destroy() throws IOException {
data.clear();
}
}
Copied: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/ContentStore.java (from r1154710, webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/impl/ContentStore.java)
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/ContentStore.java?p2=webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/ContentStore.java&p1=webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/impl/ContentStore.java&r1=1154710&r2=1156718&rev=1156718&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/impl/ContentStore.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/ContentStore.java Thu Aug 11 18:32:04 2011
@@ -17,7 +17,7 @@
* under the License.
*/
-package org.apache.axiom.attachments.impl;
+package org.apache.axiom.attachments;
import java.io.IOException;
import java.io.InputStream;
@@ -28,8 +28,8 @@ import javax.activation.DataSource;
/**
* Stores the content of a MIME part.
*/
-public abstract class ContentStore {
- public abstract InputStream getInputStream() throws IOException;
+abstract class ContentStore {
+ abstract InputStream getInputStream() throws IOException;
/**
* Get a {@link DataSource} implementation specific for this buffering strategy.
@@ -38,11 +38,11 @@ public abstract class ContentStore {
* @return the {@link DataSource} implementation or <code>null</code> if a default
* {@link DataSource} implementation should be used
*/
- public abstract DataSource getDataSource(String contentType);
+ abstract DataSource getDataSource(String contentType);
- public abstract void writeTo(OutputStream out) throws IOException;
+ abstract void writeTo(OutputStream out) throws IOException;
- public abstract long getSize();
+ abstract long getSize();
- public abstract void destroy() throws IOException;
+ abstract void destroy() throws IOException;
}
Copied: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/ContentStoreFactory.java (from r1154682, webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/impl/ContentStoreFactory.java)
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/ContentStoreFactory.java?p2=webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/ContentStoreFactory.java&p1=webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/impl/ContentStoreFactory.java&r1=1154682&r2=1156718&rev=1156718&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/impl/ContentStoreFactory.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/ContentStoreFactory.java Thu Aug 11 18:32:04 2011
@@ -17,8 +17,9 @@
* under the License.
*/
-package org.apache.axiom.attachments.impl;
+package org.apache.axiom.attachments;
+import org.apache.axiom.attachments.impl.BufferUtils;
import org.apache.axiom.attachments.lifecycle.LifecycleManager;
import org.apache.axiom.attachments.utils.BAAInputStream;
import org.apache.axiom.attachments.utils.BAAOutputStream;
@@ -39,7 +40,7 @@ import java.io.InputStream;
* other layers of the code. The PartFactory helps maintain this
* abstraction, and makes it easier to add new implementations.
*/
-public class ContentStoreFactory {
+class ContentStoreFactory {
private static int inflight = 0; // How many attachments are currently being built.
private static String semifore = "PartFactory.semifore";
@@ -74,7 +75,7 @@ public class ContentStoreFactory {
* @return Part
* @throws OMException if any exception is encountered while processing.
*/
- public static ContentStore createContentStore(LifecycleManager manager, MimeTokenStream parser,
+ static ContentStore createContentStore(LifecycleManager manager, MimeTokenStream parser,
boolean isSOAPPart,
int thresholdSize,
String attachmentDir,
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/MIMEMessage.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/MIMEMessage.java?rev=1156718&r1=1156717&r2=1156718&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/MIMEMessage.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/MIMEMessage.java Thu Aug 11 18:32:04 2011
@@ -31,8 +31,6 @@ import javax.mail.Header;
import javax.mail.internet.ContentType;
import javax.mail.internet.ParseException;
-import org.apache.axiom.attachments.impl.ContentStore;
-import org.apache.axiom.attachments.impl.ContentStoreFactory;
import org.apache.axiom.attachments.lifecycle.LifecycleManager;
import org.apache.axiom.attachments.lifecycle.impl.LifecycleManagerImpl;
import org.apache.axiom.om.OMException;
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/Part.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/Part.java?rev=1156718&r1=1156717&r2=1156718&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/Part.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/Part.java Thu Aug 11 18:32:04 2011
@@ -29,7 +29,7 @@ import javax.mail.MessagingException;
*
* A Part is created with the PartFactory.
*
- * @see org.apache.axiom.attachments.impl.ContentStoreFactory
+ * @see org.apache.axiom.attachments.ContentStoreFactory
*/
public interface Part {
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/PartImpl.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/PartImpl.java?rev=1156718&r1=1156717&r2=1156718&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/PartImpl.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/PartImpl.java Thu Aug 11 18:32:04 2011
@@ -20,7 +20,6 @@
package org.apache.axiom.attachments;
import org.apache.axiom.attachments.Part;
-import org.apache.axiom.attachments.impl.ContentStore;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -51,7 +50,7 @@ final class PartImpl implements Part {
/**
* The actual parts are constructed with the PartFactory.
- * @see org.apache.axiom.attachments.impl.ContentStoreFactory
+ * @see org.apache.axiom.attachments.ContentStoreFactory
* @param headers
*/
PartImpl(Hashtable in, ContentStore content) {