Author: rdonkin
Date: Mon Feb  4 13:10:35 2008
New Revision: 618439

URL: http://svn.apache.org/viewvc?rev=618439&view=rev
Log:
MIME4J-35 Split BodyDescriptor into a mutable / immutable interface pair 
(https://issues.apache.org/jira/browse/MIME4J-35). Contributed by Oleg 
Kalnichevski. Amended by myself: renamed ContentProperties -> ContentDescriptor 
for consistency.

Added:
    
james/mime4j/trunk/src/main/java/org/apache/james/mime4j/ContentDescriptor.java
Modified:
    james/mime4j/trunk/src/main/java/org/apache/james/mime4j/BodyDescriptor.java

Modified: 
james/mime4j/trunk/src/main/java/org/apache/james/mime4j/BodyDescriptor.java
URL: 
http://svn.apache.org/viewvc/james/mime4j/trunk/src/main/java/org/apache/james/mime4j/BodyDescriptor.java?rev=618439&r1=618438&r2=618439&view=diff
==============================================================================
--- 
james/mime4j/trunk/src/main/java/org/apache/james/mime4j/BodyDescriptor.java 
(original)
+++ 
james/mime4j/trunk/src/main/java/org/apache/james/mime4j/BodyDescriptor.java 
Mon Feb  4 13:10:35 2008
@@ -19,8 +19,6 @@
 
 package org.apache.james.mime4j;
 
-import java.util.Map;
-
 /**
  * Encapsulates the values of the MIME-specific header fields 
  * (which starts with <code>Content-</code>). 
@@ -28,7 +26,7 @@
  * 
  * @version $Id: BodyDescriptor.java,v 1.4 2005/02/11 10:08:37 ntherning Exp $
  */
-public interface BodyDescriptor {
+public interface BodyDescriptor extends ContentDescriptor {
     /**
      * Returns the body descriptors boundary.
      * @return Boundary string, if known, or null. The latter may be the
@@ -43,38 +41,4 @@
      */
     void addField(String pFieldName, String pFieldValue);
 
-    /**
-     * Returns the body descriptors MIME type.
-     * @return The MIME type, which has been parsed from the
-     *   content-type definition. Must not be null, but
-     *   "text/plain", if no content-type was specified.
-     */
-    String getMimeType();
-
-    /**
-     * The body descriptors character set.
-     * @return Character set, which has been parsed from the
-     *   content-type definition. Must not be null, but "US-ASCII",
-     *   if no content-type was specified.
-     */
-    String getCharset();
-
-    /**
-     * Returns the body descriptors transfer encoding.
-     * @return The transfer encoding. Must not be null, but "7bit",
-     *   if no transfer-encoding was specified.
-     */
-    String getTransferEncoding();
-
-    /**
-     * Returns the map of parameters of the content-type header.
-     */
-    Map getParameters();
-
-    /**
-     * Returns the body descriptors content-length.
-     * @return Content length, if known, or -1, to indicate the absence of a
-     *   content-length header.
-     */
-    long getContentLength();
 }

Added: 
james/mime4j/trunk/src/main/java/org/apache/james/mime4j/ContentDescriptor.java
URL: 
http://svn.apache.org/viewvc/james/mime4j/trunk/src/main/java/org/apache/james/mime4j/ContentDescriptor.java?rev=618439&view=auto
==============================================================================
--- 
james/mime4j/trunk/src/main/java/org/apache/james/mime4j/ContentDescriptor.java 
(added)
+++ 
james/mime4j/trunk/src/main/java/org/apache/james/mime4j/ContentDescriptor.java 
Mon Feb  4 13:10:35 2008
@@ -0,0 +1,66 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.mime4j;
+
+import java.util.Map;
+
+/**
+ * Represents common content properties. 
+ *
+ * 
+ * @version $Id:$
+ */
+public interface ContentDescriptor {
+    /**
+     * Returns the body descriptors MIME type.
+     * @return The MIME type, which has been parsed from the
+     *   content-type definition. Must not be null, but
+     *   "text/plain", if no content-type was specified.
+     */
+    String getMimeType();
+
+    /**
+     * The body descriptors character set.
+     * @return Character set, which has been parsed from the
+     *   content-type definition. Must not be null, but "US-ASCII",
+     *   if no content-type was specified.
+     */
+    String getCharset();
+
+    /**
+     * Returns the body descriptors transfer encoding.
+     * @return The transfer encoding. Must not be null, but "7bit",
+     *   if no transfer-encoding was specified.
+     */
+    String getTransferEncoding();
+
+    /**
+     * Returns the map of parameters of the content-type header.
+     */
+    Map getParameters();
+
+    /**
+     * Returns the body descriptors content-length.
+     * @return Content length, if known, or -1, to indicate the absence of a
+     *   content-length header.
+     */
+    long getContentLength();
+    
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to