james-mime4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b...@apache.org
Subject svn commit: r894882 - in /james/mime4j/branches/cycleclean/core/src/main/java/org/apache/james/mime4j/message: Entity.java Message.java impl/BodyPart.java
Date Thu, 31 Dec 2009 16:31:35 GMT
Author: bago
Date: Thu Dec 31 16:31:35 2009
New Revision: 894882

URL: http://svn.apache.org/viewvc?rev=894882&view=rev
Log:
Moved "Fields" depending method from Entity (api) to BodyPart (impl) (MIME4J-156)

Modified:
    james/mime4j/branches/cycleclean/core/src/main/java/org/apache/james/mime4j/message/Entity.java
    james/mime4j/branches/cycleclean/core/src/main/java/org/apache/james/mime4j/message/Message.java
    james/mime4j/branches/cycleclean/core/src/main/java/org/apache/james/mime4j/message/impl/BodyPart.java

Modified: james/mime4j/branches/cycleclean/core/src/main/java/org/apache/james/mime4j/message/Entity.java
URL: http://svn.apache.org/viewvc/james/mime4j/branches/cycleclean/core/src/main/java/org/apache/james/mime4j/message/Entity.java?rev=894882&r1=894881&r2=894882&view=diff
==============================================================================
--- james/mime4j/branches/cycleclean/core/src/main/java/org/apache/james/mime4j/message/Entity.java
(original)
+++ james/mime4j/branches/cycleclean/core/src/main/java/org/apache/james/mime4j/message/Entity.java
Thu Dec 31 16:31:35 2009
@@ -29,7 +29,6 @@
 import org.apache.james.mime4j.field.ContentTypeField;
 import org.apache.james.mime4j.field.Field;
 import org.apache.james.mime4j.field.FieldName;
-import org.apache.james.mime4j.field.Fields;
 
 /**
  * MIME entity. An entity has a header and a body (see RFC 2045).
@@ -528,26 +527,17 @@
 
     protected abstract String newUniqueBoundary();
 
-    protected ContentDispositionField newContentDisposition(
+    protected abstract ContentDispositionField newContentDisposition(
             String dispositionType, String filename, long size,
-            Date creationDate, Date modificationDate, Date readDate) {
-        return Fields.contentDisposition(dispositionType, filename, size,
-                creationDate, modificationDate, readDate);
-    }
+            Date creationDate, Date modificationDate, Date readDate);
 
-    protected ContentDispositionField newContentDisposition(
-            String dispositionType, Map<String, String> parameters) {
-        return Fields.contentDisposition(dispositionType, parameters);
-    }
+    protected abstract ContentDispositionField newContentDisposition(
+            String dispositionType, Map<String, String> parameters);
 
-    protected ContentTypeField newContentType(String mimeType,
-            Map<String, String> parameters) {
-        return Fields.contentType(mimeType, parameters);
-    }
+    protected abstract ContentTypeField newContentType(String mimeType,
+            Map<String, String> parameters);
 
-    protected ContentTransferEncodingField newContentTransferEncoding(
-            String contentTransferEncoding) {
-        return Fields.contentTransferEncoding(contentTransferEncoding);
-    }
+    protected abstract ContentTransferEncodingField newContentTransferEncoding(
+            String contentTransferEncoding);
 
 }

Modified: james/mime4j/branches/cycleclean/core/src/main/java/org/apache/james/mime4j/message/Message.java
URL: http://svn.apache.org/viewvc/james/mime4j/branches/cycleclean/core/src/main/java/org/apache/james/mime4j/message/Message.java?rev=894882&r1=894881&r2=894882&view=diff
==============================================================================
--- james/mime4j/branches/cycleclean/core/src/main/java/org/apache/james/mime4j/message/Message.java
(original)
+++ james/mime4j/branches/cycleclean/core/src/main/java/org/apache/james/mime4j/message/Message.java
Thu Dec 31 16:31:35 2009
@@ -26,11 +26,15 @@
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Date;
+import java.util.Map;
 import java.util.TimeZone;
 
 import org.apache.james.mime4j.MimeException;
 import org.apache.james.mime4j.MimeIOException;
 import org.apache.james.mime4j.field.AddressListField;
+import org.apache.james.mime4j.field.ContentDispositionField;
+import org.apache.james.mime4j.field.ContentTransferEncodingField;
+import org.apache.james.mime4j.field.ContentTypeField;
 import org.apache.james.mime4j.field.DateTimeField;
 import org.apache.james.mime4j.field.Field;
 import org.apache.james.mime4j.field.FieldName;
@@ -639,8 +643,30 @@
 		return Fields.addressList(fieldName, addresses);
 	}
 
-	private UnstructuredField newSubject(String subject) {
+	protected UnstructuredField newSubject(String subject) {
 		return Fields.subject(subject);
 	}
 
+    protected ContentDispositionField newContentDisposition(
+            String dispositionType, String filename, long size,
+            Date creationDate, Date modificationDate, Date readDate) {
+        return Fields.contentDisposition(dispositionType, filename, size,
+                creationDate, modificationDate, readDate);
+    }
+
+    protected ContentDispositionField newContentDisposition(
+            String dispositionType, Map<String, String> parameters) {
+        return Fields.contentDisposition(dispositionType, parameters);
+    }
+
+    protected ContentTypeField newContentType(String mimeType,
+            Map<String, String> parameters) {
+        return Fields.contentType(mimeType, parameters);
+    }
+
+    protected ContentTransferEncodingField newContentTransferEncoding(
+            String contentTransferEncoding) {
+        return Fields.contentTransferEncoding(contentTransferEncoding);
+    }
+
 }

Modified: james/mime4j/branches/cycleclean/core/src/main/java/org/apache/james/mime4j/message/impl/BodyPart.java
URL: http://svn.apache.org/viewvc/james/mime4j/branches/cycleclean/core/src/main/java/org/apache/james/mime4j/message/impl/BodyPart.java?rev=894882&r1=894881&r2=894882&view=diff
==============================================================================
--- james/mime4j/branches/cycleclean/core/src/main/java/org/apache/james/mime4j/message/impl/BodyPart.java
(original)
+++ james/mime4j/branches/cycleclean/core/src/main/java/org/apache/james/mime4j/message/impl/BodyPart.java
Thu Dec 31 16:31:35 2009
@@ -19,6 +19,13 @@
 
 package org.apache.james.mime4j.message.impl;
 
+import java.util.Date;
+import java.util.Map;
+
+import org.apache.james.mime4j.field.ContentDispositionField;
+import org.apache.james.mime4j.field.ContentTransferEncodingField;
+import org.apache.james.mime4j.field.ContentTypeField;
+import org.apache.james.mime4j.field.Fields;
 import org.apache.james.mime4j.message.Body;
 import org.apache.james.mime4j.message.Entity;
 import org.apache.james.mime4j.message.Header;
@@ -71,4 +78,26 @@
 		return MimeUtil.createUniqueBoundary();
 	}
 
+    protected ContentDispositionField newContentDisposition(
+            String dispositionType, String filename, long size,
+            Date creationDate, Date modificationDate, Date readDate) {
+        return Fields.contentDisposition(dispositionType, filename, size,
+                creationDate, modificationDate, readDate);
+    }
+
+    protected ContentDispositionField newContentDisposition(
+            String dispositionType, Map<String, String> parameters) {
+        return Fields.contentDisposition(dispositionType, parameters);
+    }
+
+    protected ContentTypeField newContentType(String mimeType,
+            Map<String, String> parameters) {
+        return Fields.contentType(mimeType, parameters);
+    }
+
+    protected ContentTransferEncodingField newContentTransferEncoding(
+            String contentTransferEncoding) {
+        return Fields.contentTransferEncoding(contentTransferEncoding);
+    }
+
 }



Mime
View raw message