james-mime4j-dev mailing list archives

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

URL: http://svn.apache.org/viewvc?rev=894915&view=rev
Log:
Move field.impl (impl) dependencies from message (api) Entity object to the implementations
(BodyPart and MessageImpl) (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/impl/BodyPart.java
    james/mime4j/branches/cycleclean/core/src/main/java/org/apache/james/mime4j/message/impl/MessageImpl.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=894915&r1=894914&r2=894915&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 18:02:20 2009
@@ -29,8 +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.impl.ContentTransferEncodingFieldImpl;
-import org.apache.james.mime4j.field.impl.ContentTypeFieldImpl;
 
 /**
  * MIME entity. An entity has a header and a body (see RFC 2045).
@@ -265,7 +263,7 @@
                                                 getField(FieldName.CONTENT_TYPE)
             : null;
         
-        return ContentTypeFieldImpl.getMimeType(child, parent);
+        return calcMimeType(child, parent);
     }
 
     private ContentTypeField getContentTypeField() {
@@ -278,8 +276,7 @@
      * @return the MIME character set encoding.
      */
     public String getCharset() {
-        return ContentTypeFieldImpl.getCharset( 
-            (ContentTypeField) getHeader().getField(FieldName.CONTENT_TYPE));
+        return calcCharset((ContentTypeField) getHeader().getField(FieldName.CONTENT_TYPE));
     }
     
     /**
@@ -291,7 +288,7 @@
         ContentTransferEncodingField f = (ContentTransferEncodingField) 
                         getHeader().getField(FieldName.CONTENT_TRANSFER_ENCODING);
         
-        return ContentTransferEncodingFieldImpl.getEncoding(f);
+        return calcTransferEncoding(f);
     }
 
     /**
@@ -545,4 +542,9 @@
     protected abstract ContentTransferEncodingField newContentTransferEncoding(
             String contentTransferEncoding);
 
+    protected abstract String calcMimeType(ContentTypeField child, ContentTypeField parent);
+
+    protected abstract String calcTransferEncoding(ContentTransferEncodingField f);
+
+    protected abstract String calcCharset(ContentTypeField contentType);
 }

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=894915&r1=894914&r2=894915&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 18:02:20 2009
@@ -25,6 +25,8 @@
 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.impl.ContentTransferEncodingFieldImpl;
+import org.apache.james.mime4j.field.impl.ContentTypeFieldImpl;
 import org.apache.james.mime4j.field.impl.Fields;
 import org.apache.james.mime4j.message.Body;
 import org.apache.james.mime4j.message.Entity;
@@ -99,4 +101,16 @@
         return Fields.contentTransferEncoding(contentTransferEncoding);
     }
 
+    protected String calcTransferEncoding(ContentTransferEncodingField f) {
+        return ContentTransferEncodingFieldImpl.getEncoding(f);
+    }
+
+    protected String calcMimeType(ContentTypeField child, ContentTypeField parent) {
+        return ContentTypeFieldImpl.getMimeType(child, parent);
+    }
+
+    protected String calcCharset(ContentTypeField contentType) {
+        return ContentTypeFieldImpl.getCharset(contentType); 
+    }
+
 }

Modified: james/mime4j/branches/cycleclean/core/src/main/java/org/apache/james/mime4j/message/impl/MessageImpl.java
URL: http://svn.apache.org/viewvc/james/mime4j/branches/cycleclean/core/src/main/java/org/apache/james/mime4j/message/impl/MessageImpl.java?rev=894915&r1=894914&r2=894915&view=diff
==============================================================================
--- james/mime4j/branches/cycleclean/core/src/main/java/org/apache/james/mime4j/message/impl/MessageImpl.java
(original)
+++ james/mime4j/branches/cycleclean/core/src/main/java/org/apache/james/mime4j/message/impl/MessageImpl.java
Thu Dec 31 18:02:20 2009
@@ -40,6 +40,8 @@
 import org.apache.james.mime4j.field.UnstructuredField;
 import org.apache.james.mime4j.field.address.Address;
 import org.apache.james.mime4j.field.address.Mailbox;
+import org.apache.james.mime4j.field.impl.ContentTransferEncodingFieldImpl;
+import org.apache.james.mime4j.field.impl.ContentTypeFieldImpl;
 import org.apache.james.mime4j.field.impl.Fields;
 import org.apache.james.mime4j.message.Body;
 import org.apache.james.mime4j.message.Header;
@@ -218,4 +220,16 @@
         return Fields.contentTransferEncoding(contentTransferEncoding);
     }
 
+    protected String calcTransferEncoding(ContentTransferEncodingField f) {
+        return ContentTransferEncodingFieldImpl.getEncoding(f);
+    }
+
+    protected String calcMimeType(ContentTypeField child, ContentTypeField parent) {
+        return ContentTypeFieldImpl.getMimeType(child, parent);
+    }
+
+    protected String calcCharset(ContentTypeField contentType) {
+        return ContentTypeFieldImpl.getCharset(contentType); 
+    }
+
 }



Mime
View raw message