james-mime4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mwiederk...@apache.org
Subject svn commit: r778457 [6/13] - in /james/mime4j/trunk: benchmark/src/main/java/org/apache/james/mime4j/ core/src/main/java/org/apache/james/mime4j/ core/src/main/java/org/apache/james/mime4j/codec/ core/src/main/java/org/apache/james/mime4j/descriptor/ c...
Date Mon, 25 May 2009 17:20:52 GMT
Propchange: james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/message/SingleBody.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/message/StorageBinaryBody.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/message/StorageTextBody.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/message/StringTextBody.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/message/TextBody.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/message/TextBody.java?rev=778457&r1=778456&r2=778457&view=diff
==============================================================================
--- james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/message/TextBody.java (original)
+++ james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/message/TextBody.java Mon May 25 17:20:48 2009
@@ -1,53 +1,53 @@
-/****************************************************************
- * 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.message;
-
-import java.io.IOException;
-import java.io.Reader;
-
-/**
- * Encapsulates the contents of a <code>text/*</code> entity body.
- */
-public abstract class TextBody extends SingleBody {
-
-    /**
-     * Sole constructor.
-     */
-    protected TextBody() {
-    }
-
-    /**
-     * Returns the MIME charset of this text body.
-     * 
-     * @return the MIME charset.
-     */
-    public abstract String getMimeCharset();
-
-    /**
-     * Gets a <code>Reader</code> which may be used to read out the contents
-     * of this body.
-     * 
-     * @return the <code>Reader</code>.
-     * @throws IOException
-     *             on I/O errors.
-     */
-    public abstract Reader getReader() throws IOException;
-
-}
+/****************************************************************
+ * 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.message;
+
+import java.io.IOException;
+import java.io.Reader;
+
+/**
+ * Encapsulates the contents of a <code>text/*</code> entity body.
+ */
+public abstract class TextBody extends SingleBody {
+
+    /**
+     * Sole constructor.
+     */
+    protected TextBody() {
+    }
+
+    /**
+     * Returns the MIME charset of this text body.
+     * 
+     * @return the MIME charset.
+     */
+    public abstract String getMimeCharset();
+
+    /**
+     * Gets a <code>Reader</code> which may be used to read out the contents
+     * of this body.
+     * 
+     * @return the <code>Reader</code>.
+     * @throws IOException
+     *             on I/O errors.
+     */
+    public abstract Reader getReader() throws IOException;
+
+}

Propchange: james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/message/TextBody.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/AbstractContentHandler.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/AbstractContentHandler.java?rev=778457&r1=778456&r2=778457&view=diff
==============================================================================
--- james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/AbstractContentHandler.java (original)
+++ james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/AbstractContentHandler.java Mon May 25 17:20:48 2009
@@ -1,115 +1,115 @@
-/****************************************************************
- * 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.parser;
-
-import org.apache.james.mime4j.MimeException;
-import org.apache.james.mime4j.descriptor.BodyDescriptor;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-/**
- * Abstract <code>ContentHandler</code> with default implementations of all
- * the methods of the <code>ContentHandler</code> interface.
- * 
- * The default is to do nothing.
- */
-public abstract class AbstractContentHandler implements ContentHandler {
-    
-    /**
-     * @see org.apache.james.mime4j.parser.ContentHandler#endMultipart()
-     */
-    public void endMultipart() throws MimeException {
-    }
-    
-    /**
-     * @see org.apache.james.mime4j.parser.ContentHandler#startMultipart(org.apache.james.mime4j.descriptor.BodyDescriptor)
-     */
-    public void startMultipart(BodyDescriptor bd) throws MimeException {
-    }
-    
-    /**
-     * @see org.apache.james.mime4j.parser.ContentHandler#body(org.apache.james.mime4j.descriptor.BodyDescriptor, java.io.InputStream)
-     */
-    public void body(BodyDescriptor bd, InputStream is)
-            throws MimeException, IOException {
-    }
-    
-    /**
-     * @see org.apache.james.mime4j.parser.ContentHandler#endBodyPart()
-     */
-    public void endBodyPart() throws MimeException {
-    }
-    
-    /**
-     * @see org.apache.james.mime4j.parser.ContentHandler#endHeader()
-     */
-    public void endHeader() throws MimeException {
-    }
-    
-    /**
-     * @see org.apache.james.mime4j.parser.ContentHandler#endMessage()
-     */
-    public void endMessage() throws MimeException {
-    }
-    
-    /**
-     * @see org.apache.james.mime4j.parser.ContentHandler#epilogue(java.io.InputStream)
-     */
-    public void epilogue(InputStream is) throws MimeException, IOException {
-    }
-    
-    /**
-     * @see org.apache.james.mime4j.parser.ContentHandler#field(Field)
-     */
-    public void field(Field field) throws MimeException {
-    }
-    
-    /**
-     * @see org.apache.james.mime4j.parser.ContentHandler#preamble(java.io.InputStream)
-     */
-    public void preamble(InputStream is) throws MimeException, IOException {
-    }
-    
-    /**
-     * @see org.apache.james.mime4j.parser.ContentHandler#startBodyPart()
-     */
-    public void startBodyPart() throws MimeException {
-    }
-    
-    /**
-     * @see org.apache.james.mime4j.parser.ContentHandler#startHeader()
-     */
-    public void startHeader() throws MimeException {
-    }
-    
-    /**
-     * @see org.apache.james.mime4j.parser.ContentHandler#startMessage()
-     */
-    public void startMessage() throws MimeException {
-    }
-    
-    /**
-     * @see org.apache.james.mime4j.parser.ContentHandler#raw(java.io.InputStream)
-     */
-    public void raw(InputStream is) throws MimeException, IOException {
-    }
-
-}
+/****************************************************************
+ * 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.parser;
+
+import org.apache.james.mime4j.MimeException;
+import org.apache.james.mime4j.descriptor.BodyDescriptor;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+/**
+ * Abstract <code>ContentHandler</code> with default implementations of all
+ * the methods of the <code>ContentHandler</code> interface.
+ * 
+ * The default is to do nothing.
+ */
+public abstract class AbstractContentHandler implements ContentHandler {
+    
+    /**
+     * @see org.apache.james.mime4j.parser.ContentHandler#endMultipart()
+     */
+    public void endMultipart() throws MimeException {
+    }
+    
+    /**
+     * @see org.apache.james.mime4j.parser.ContentHandler#startMultipart(org.apache.james.mime4j.descriptor.BodyDescriptor)
+     */
+    public void startMultipart(BodyDescriptor bd) throws MimeException {
+    }
+    
+    /**
+     * @see org.apache.james.mime4j.parser.ContentHandler#body(org.apache.james.mime4j.descriptor.BodyDescriptor, java.io.InputStream)
+     */
+    public void body(BodyDescriptor bd, InputStream is)
+            throws MimeException, IOException {
+    }
+    
+    /**
+     * @see org.apache.james.mime4j.parser.ContentHandler#endBodyPart()
+     */
+    public void endBodyPart() throws MimeException {
+    }
+    
+    /**
+     * @see org.apache.james.mime4j.parser.ContentHandler#endHeader()
+     */
+    public void endHeader() throws MimeException {
+    }
+    
+    /**
+     * @see org.apache.james.mime4j.parser.ContentHandler#endMessage()
+     */
+    public void endMessage() throws MimeException {
+    }
+    
+    /**
+     * @see org.apache.james.mime4j.parser.ContentHandler#epilogue(java.io.InputStream)
+     */
+    public void epilogue(InputStream is) throws MimeException, IOException {
+    }
+    
+    /**
+     * @see org.apache.james.mime4j.parser.ContentHandler#field(Field)
+     */
+    public void field(Field field) throws MimeException {
+    }
+    
+    /**
+     * @see org.apache.james.mime4j.parser.ContentHandler#preamble(java.io.InputStream)
+     */
+    public void preamble(InputStream is) throws MimeException, IOException {
+    }
+    
+    /**
+     * @see org.apache.james.mime4j.parser.ContentHandler#startBodyPart()
+     */
+    public void startBodyPart() throws MimeException {
+    }
+    
+    /**
+     * @see org.apache.james.mime4j.parser.ContentHandler#startHeader()
+     */
+    public void startHeader() throws MimeException {
+    }
+    
+    /**
+     * @see org.apache.james.mime4j.parser.ContentHandler#startMessage()
+     */
+    public void startMessage() throws MimeException {
+    }
+    
+    /**
+     * @see org.apache.james.mime4j.parser.ContentHandler#raw(java.io.InputStream)
+     */
+    public void raw(InputStream is) throws MimeException, IOException {
+    }
+
+}

Propchange: james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/AbstractContentHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/AbstractEntity.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/ContentHandler.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/ContentHandler.java?rev=778457&r1=778456&r2=778457&view=diff
==============================================================================
--- james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/ContentHandler.java (original)
+++ james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/ContentHandler.java Mon May 25 17:20:48 2009
@@ -1,201 +1,201 @@
-/****************************************************************
- * 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.parser;
-
-import org.apache.james.mime4j.MimeException;
-import org.apache.james.mime4j.descriptor.BodyDescriptor;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-/**
- * <p>
- * Receives notifications of the content of a plain RFC822 or MIME message.
- * Implement this interface and register an instance of that implementation
- * with a <code>MimeStreamParser</code> instance using its 
- * {@link org.apache.james.mime4j.parser.MimeStreamParser#setContentHandler(ContentHandler)}
- * method. The parser uses the <code>ContentHandler</code> instance to report
- * basic message-related events like the start and end of the body of a
- * part in a multipart MIME entity.
- * </p>
- * <p>
- * Throwing an exception from an event method will terminate the message
- * processing, i.e. no new events will be generated for that message. 
- * <p>
- * Events will be generated in the order the corresponding elements occur in
- * the message stream parsed by the parser. E.g.:
- * <pre>
- *      startMessage()
- *          startHeader()
- *              field(...)
- *              field(...)
- *              ...
- *          endHeader()
- *          startMultipart()
- *              preamble(...)
- *              startBodyPart()
- *                  startHeader()
- *                      field(...)
- *                      field(...)
- *                      ...
- *                  endHeader()
- *                  body()
- *              endBodyPart()
- *              startBodyPart()
- *                  startHeader()
- *                      field(...)
- *                      field(...)
- *                      ...
- *                  endHeader()
- *                  body()
- *              endBodyPart()
- *              epilogue(...)
- *          endMultipart()
- *      endMessage()
- * </pre>
- * The above shows an example of a MIME message consisting of a multipart
- * body containing two body parts.
- * </p>
- * <p>
- * See MIME RFCs 2045-2049 for more information on the structure of MIME 
- * messages and RFC 822 and 2822 for the general structure of Internet mail
- * messages.
- * </p>
- */
-public interface ContentHandler {
-
-    /**
-     * Called when a new message starts (a top level message or an embedded 
-     * rfc822 message).
-     *
-     * @throws MimeException on processing errors
-     */
-    void startMessage() throws MimeException;
-
-    /**
-     * Called when a message ends.
-     *
-     * @throws MimeException on processing errors
-     */
-    void endMessage() throws MimeException;
-
-    /**
-     * Called when a new body part starts inside a
-     * <code>multipart/*</code> entity.
-     *
-     * @throws MimeException on processing errors
-     */
-    void startBodyPart() throws MimeException;
-
-    /**
-     * Called when a body part ends.
-     *
-     * @throws MimeException on processing errors
-     */
-    void endBodyPart() throws MimeException;
-
-    /**
-     * Called when a header (of a message or body part) is about to be parsed.
-     *
-     * @throws MimeException on processing errors
-     */
-    void startHeader() throws MimeException;
-
-    /**
-     * Called for each field of a header.
-     * 
-     * @param field the MIME field.
-     * @throws MimeException on processing errors
-     */
-    void field(Field field) throws MimeException;
-
-    /**
-     * Called when there are no more header fields in a message or body part.
-     *
-     * @throws MimeException on processing errors
-     */
-    void endHeader() throws MimeException;
-
-    /**
-     * Called for the preamble (whatever comes before the first body part)
-     * of a <code>multipart/*</code> entity.
-     * 
-     * @param is used to get the contents of the preamble.
-     * @throws MimeException on processing errors
-     * @throws IOException should be thrown on I/O errors.
-     */
-    void preamble(InputStream is) throws MimeException, IOException;
-
-    /**
-     * Called for the epilogue (whatever comes after the final body part) 
-     * of a <code>multipart/*</code> entity.
-     * 
-     * @param is used to get the contents of the epilogue.
-     * @throws MimeException on processing errors
-     * @throws IOException should be thrown on I/O errors.
-     */
-    void epilogue(InputStream is) throws MimeException, IOException;
-
-    /**
-     * Called when the body of a multipart entity is about to be parsed.
-     * 
-     * @param bd encapsulates the values (either read from the 
-     *        message stream or, if not present, determined implictly 
-     *        as described in the 
-     *        MIME rfc:s) of the <code>Content-Type</code> and 
-     *        <code>Content-Transfer-Encoding</code> header fields.
-     * @throws MimeException on processing errors
-     */
-    void startMultipart(BodyDescriptor bd) throws MimeException;
-
-    /**
-     * Called when the body of an entity has been parsed.
-     *
-     * @throws MimeException on processing errors
-     */
-    void endMultipart() throws MimeException;
-
-    /**
-     * Called when the body of a discrete (non-multipart) entity is about to 
-     * be parsed.
-     * 
-     * @param bd see {@link #startMultipart(BodyDescriptor)}
-     * @param is the contents of the body. NOTE: this is the raw body contents 
-     *           - it will not be decoded if encoded. The <code>bd</code>
-     *           parameter should be used to determine how the stream data
-     *           should be decoded.
-     * @throws MimeException on processing errors
-     * @throws IOException should be thrown on I/O errors.
-     */
-    void body(BodyDescriptor bd, InputStream is)
-        throws MimeException, IOException;
-
-    /**
-     * Called when a new entity (message or body part) starts and the 
-     * parser is in <code>raw</code> mode.
-     * 
-     * @param is the raw contents of the entity.
-     * @throws MimeException on processing errors
-     * @throws IOException should be thrown on I/O errors.
-     * @see MimeStreamParser#setRaw(boolean)
-     */
-    void raw(InputStream is) throws MimeException, IOException;
-
-}
+/****************************************************************
+ * 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.parser;
+
+import org.apache.james.mime4j.MimeException;
+import org.apache.james.mime4j.descriptor.BodyDescriptor;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+/**
+ * <p>
+ * Receives notifications of the content of a plain RFC822 or MIME message.
+ * Implement this interface and register an instance of that implementation
+ * with a <code>MimeStreamParser</code> instance using its 
+ * {@link org.apache.james.mime4j.parser.MimeStreamParser#setContentHandler(ContentHandler)}
+ * method. The parser uses the <code>ContentHandler</code> instance to report
+ * basic message-related events like the start and end of the body of a
+ * part in a multipart MIME entity.
+ * </p>
+ * <p>
+ * Throwing an exception from an event method will terminate the message
+ * processing, i.e. no new events will be generated for that message. 
+ * <p>
+ * Events will be generated in the order the corresponding elements occur in
+ * the message stream parsed by the parser. E.g.:
+ * <pre>
+ *      startMessage()
+ *          startHeader()
+ *              field(...)
+ *              field(...)
+ *              ...
+ *          endHeader()
+ *          startMultipart()
+ *              preamble(...)
+ *              startBodyPart()
+ *                  startHeader()
+ *                      field(...)
+ *                      field(...)
+ *                      ...
+ *                  endHeader()
+ *                  body()
+ *              endBodyPart()
+ *              startBodyPart()
+ *                  startHeader()
+ *                      field(...)
+ *                      field(...)
+ *                      ...
+ *                  endHeader()
+ *                  body()
+ *              endBodyPart()
+ *              epilogue(...)
+ *          endMultipart()
+ *      endMessage()
+ * </pre>
+ * The above shows an example of a MIME message consisting of a multipart
+ * body containing two body parts.
+ * </p>
+ * <p>
+ * See MIME RFCs 2045-2049 for more information on the structure of MIME 
+ * messages and RFC 822 and 2822 for the general structure of Internet mail
+ * messages.
+ * </p>
+ */
+public interface ContentHandler {
+
+    /**
+     * Called when a new message starts (a top level message or an embedded 
+     * rfc822 message).
+     *
+     * @throws MimeException on processing errors
+     */
+    void startMessage() throws MimeException;
+
+    /**
+     * Called when a message ends.
+     *
+     * @throws MimeException on processing errors
+     */
+    void endMessage() throws MimeException;
+
+    /**
+     * Called when a new body part starts inside a
+     * <code>multipart/*</code> entity.
+     *
+     * @throws MimeException on processing errors
+     */
+    void startBodyPart() throws MimeException;
+
+    /**
+     * Called when a body part ends.
+     *
+     * @throws MimeException on processing errors
+     */
+    void endBodyPart() throws MimeException;
+
+    /**
+     * Called when a header (of a message or body part) is about to be parsed.
+     *
+     * @throws MimeException on processing errors
+     */
+    void startHeader() throws MimeException;
+
+    /**
+     * Called for each field of a header.
+     * 
+     * @param field the MIME field.
+     * @throws MimeException on processing errors
+     */
+    void field(Field field) throws MimeException;
+
+    /**
+     * Called when there are no more header fields in a message or body part.
+     *
+     * @throws MimeException on processing errors
+     */
+    void endHeader() throws MimeException;
+
+    /**
+     * Called for the preamble (whatever comes before the first body part)
+     * of a <code>multipart/*</code> entity.
+     * 
+     * @param is used to get the contents of the preamble.
+     * @throws MimeException on processing errors
+     * @throws IOException should be thrown on I/O errors.
+     */
+    void preamble(InputStream is) throws MimeException, IOException;
+
+    /**
+     * Called for the epilogue (whatever comes after the final body part) 
+     * of a <code>multipart/*</code> entity.
+     * 
+     * @param is used to get the contents of the epilogue.
+     * @throws MimeException on processing errors
+     * @throws IOException should be thrown on I/O errors.
+     */
+    void epilogue(InputStream is) throws MimeException, IOException;
+
+    /**
+     * Called when the body of a multipart entity is about to be parsed.
+     * 
+     * @param bd encapsulates the values (either read from the 
+     *        message stream or, if not present, determined implictly 
+     *        as described in the 
+     *        MIME rfc:s) of the <code>Content-Type</code> and 
+     *        <code>Content-Transfer-Encoding</code> header fields.
+     * @throws MimeException on processing errors
+     */
+    void startMultipart(BodyDescriptor bd) throws MimeException;
+
+    /**
+     * Called when the body of an entity has been parsed.
+     *
+     * @throws MimeException on processing errors
+     */
+    void endMultipart() throws MimeException;
+
+    /**
+     * Called when the body of a discrete (non-multipart) entity is about to 
+     * be parsed.
+     * 
+     * @param bd see {@link #startMultipart(BodyDescriptor)}
+     * @param is the contents of the body. NOTE: this is the raw body contents 
+     *           - it will not be decoded if encoded. The <code>bd</code>
+     *           parameter should be used to determine how the stream data
+     *           should be decoded.
+     * @throws MimeException on processing errors
+     * @throws IOException should be thrown on I/O errors.
+     */
+    void body(BodyDescriptor bd, InputStream is)
+        throws MimeException, IOException;
+
+    /**
+     * Called when a new entity (message or body part) starts and the 
+     * parser is in <code>raw</code> mode.
+     * 
+     * @param is the raw contents of the entity.
+     * @throws MimeException on processing errors
+     * @throws IOException should be thrown on I/O errors.
+     * @see MimeStreamParser#setRaw(boolean)
+     */
+    void raw(InputStream is) throws MimeException, IOException;
+
+}

Propchange: james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/ContentHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/EntityStateMachine.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/EntityStateMachine.java?rev=778457&r1=778456&r2=778457&view=diff
==============================================================================
--- james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/EntityStateMachine.java (original)
+++ james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/EntityStateMachine.java Mon May 25 17:20:48 2009
@@ -1,103 +1,103 @@
-/****************************************************************
- * 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.parser;
-
-import org.apache.james.mime4j.MimeException;
-import org.apache.james.mime4j.descriptor.BodyDescriptor;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-/**
- * Represents the interal state of a MIME entity, which is being retrieved 
- * from an input stream by a MIME parser.
- */
-public interface EntityStateMachine {
-
-    /**
-     * Return the current state of the entity.
-     * 
-     * @see EntityStates
-     * 
-     * @return current state
-     */
-    int getState();
-    
-    /**
-     * Sets the current recursion mode.
-     * The recursion mode specifies the approach taken to parsing parts.
-     * {@link RecursionMode#M_RAW} mode does not parse the part at all.
-     * {@link RecursionMode#M_RECURSE} mode recursively parses each mail
-     * when an <code>message/rfc822</code> part is encounted;
-     * {@link RecursionMode#M_NO_RECURSE} does not.
-     * 
-     * @see RecursionMode
-     * 
-     * @param recursionMode
-     */
-    void setRecursionMode(int recursionMode);
-    
-    /**
-     * Advances the state machine to the next state in the 
-     * process of the MIME stream parsing. This method 
-     * may return an new state machine that represents an embedded 
-     * entity, which must be parsed before the parsing process of 
-     * the current entity can proceed.
-     * 
-     * @return a state machine of an embedded entity, if encountered, 
-     * <code>null</code> otherwise.
-     *  
-     * @throws IOException if an I/O error occurs.
-     * @throws MimeException if the message can not be processed due 
-     *  to the MIME specification violation.
-     */
-    EntityStateMachine advance() throws IOException, MimeException;
-    
-    /**
-     * Returns description of the entity body.
-     * 
-     * @return body description
-     * 
-     * @throws IllegalStateException if the body description cannot be
-     *  obtained at the current stage of the parsing process. 
-     */
-    BodyDescriptor getBodyDescriptor() throws IllegalStateException;
-    
-    /**
-     * Returns content stream of the entity body.
-     * 
-     * @return input stream
-     * 
-     * @throws IllegalStateException if the content stream cannot be
-     *  obtained at the current stage of the parsing process. 
-     */
-    InputStream getContentStream() throws IllegalStateException;
- 
-    /**
-     * Returns current header field.
-     * 
-     * @return header field
-     * 
-     * @throws IllegalStateException if a header field cannot be
-     *  obtained at the current stage of the parsing process. 
-     */
-    Field getField() throws IllegalStateException;
-    
-}
+/****************************************************************
+ * 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.parser;
+
+import org.apache.james.mime4j.MimeException;
+import org.apache.james.mime4j.descriptor.BodyDescriptor;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+/**
+ * Represents the interal state of a MIME entity, which is being retrieved 
+ * from an input stream by a MIME parser.
+ */
+public interface EntityStateMachine {
+
+    /**
+     * Return the current state of the entity.
+     * 
+     * @see EntityStates
+     * 
+     * @return current state
+     */
+    int getState();
+    
+    /**
+     * Sets the current recursion mode.
+     * The recursion mode specifies the approach taken to parsing parts.
+     * {@link RecursionMode#M_RAW} mode does not parse the part at all.
+     * {@link RecursionMode#M_RECURSE} mode recursively parses each mail
+     * when an <code>message/rfc822</code> part is encounted;
+     * {@link RecursionMode#M_NO_RECURSE} does not.
+     * 
+     * @see RecursionMode
+     * 
+     * @param recursionMode
+     */
+    void setRecursionMode(int recursionMode);
+    
+    /**
+     * Advances the state machine to the next state in the 
+     * process of the MIME stream parsing. This method 
+     * may return an new state machine that represents an embedded 
+     * entity, which must be parsed before the parsing process of 
+     * the current entity can proceed.
+     * 
+     * @return a state machine of an embedded entity, if encountered, 
+     * <code>null</code> otherwise.
+     *  
+     * @throws IOException if an I/O error occurs.
+     * @throws MimeException if the message can not be processed due 
+     *  to the MIME specification violation.
+     */
+    EntityStateMachine advance() throws IOException, MimeException;
+    
+    /**
+     * Returns description of the entity body.
+     * 
+     * @return body description
+     * 
+     * @throws IllegalStateException if the body description cannot be
+     *  obtained at the current stage of the parsing process. 
+     */
+    BodyDescriptor getBodyDescriptor() throws IllegalStateException;
+    
+    /**
+     * Returns content stream of the entity body.
+     * 
+     * @return input stream
+     * 
+     * @throws IllegalStateException if the content stream cannot be
+     *  obtained at the current stage of the parsing process. 
+     */
+    InputStream getContentStream() throws IllegalStateException;
+ 
+    /**
+     * Returns current header field.
+     * 
+     * @return header field
+     * 
+     * @throws IllegalStateException if a header field cannot be
+     *  obtained at the current stage of the parsing process. 
+     */
+    Field getField() throws IllegalStateException;
+    
+}

Propchange: james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/EntityStateMachine.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/EntityStates.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/EntityStates.java?rev=778457&r1=778456&r2=778457&view=diff
==============================================================================
--- james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/EntityStates.java (original)
+++ james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/EntityStates.java Mon May 25 17:20:48 2009
@@ -1,95 +1,95 @@
-/****************************************************************
- * 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.parser;
-
-/**
- * Enumeration of states an entity is expected to go through
- * in the process of the MIME stream parsing.
- */
-public interface EntityStates {
-
-    /**
-     * This token indicates, that the MIME stream has been completely
-     * and successfully parsed, and no more data is available.
-     */
-    int T_END_OF_STREAM = -1;
-    /**
-     * This token indicates, that the MIME stream is currently
-     * at the beginning of a message.
-     */
-    int T_START_MESSAGE = 0;
-    /**
-     * This token indicates, that the MIME stream is currently
-     * at the end of a message.
-     */
-    int T_END_MESSAGE = 1;
-    /**
-     * This token indicates, that a raw entity is currently being processed.
-     */
-    int T_RAW_ENTITY = 2;
-    /**
-     * This token indicates, that a message parts headers are now
-     * being parsed.
-     */
-    int T_START_HEADER = 3;
-    /**
-     * This token indicates, that a message parts field has now
-     * been parsed. 
-     */
-    int T_FIELD = 4;
-    /**
-     * This token indicates, that part headers have now been
-     * parsed.
-     */
-    int T_END_HEADER = 5;
-    /**
-     * This token indicates, that a multipart body is being parsed.
-     */
-    int T_START_MULTIPART = 6;
-    /**
-     * This token indicates, that a multipart body has been parsed.
-     */
-    int T_END_MULTIPART = 7;
-    /**
-     * This token indicates, that a multiparts preamble is being
-     * parsed. 
-     */
-    int T_PREAMBLE = 8;
-    /**
-     * This token indicates, that a multiparts epilogue is being
-     * parsed. 
-     */
-    int T_EPILOGUE = 9;
-    /**
-     * This token indicates, that the MIME stream is currently
-     * at the beginning of a body part.
-     */
-    int T_START_BODYPART = 10;
-    /**
-     * This token indicates, that the MIME stream is currently
-     * at the end of a body part.
-     */
-    int T_END_BODYPART = 11;
-    /**
-     * This token indicates, that an atomic entity is being parsed.
-     */
-    int T_BODY = 12;
-
-}
+/****************************************************************
+ * 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.parser;
+
+/**
+ * Enumeration of states an entity is expected to go through
+ * in the process of the MIME stream parsing.
+ */
+public interface EntityStates {
+
+    /**
+     * This token indicates, that the MIME stream has been completely
+     * and successfully parsed, and no more data is available.
+     */
+    int T_END_OF_STREAM = -1;
+    /**
+     * This token indicates, that the MIME stream is currently
+     * at the beginning of a message.
+     */
+    int T_START_MESSAGE = 0;
+    /**
+     * This token indicates, that the MIME stream is currently
+     * at the end of a message.
+     */
+    int T_END_MESSAGE = 1;
+    /**
+     * This token indicates, that a raw entity is currently being processed.
+     */
+    int T_RAW_ENTITY = 2;
+    /**
+     * This token indicates, that a message parts headers are now
+     * being parsed.
+     */
+    int T_START_HEADER = 3;
+    /**
+     * This token indicates, that a message parts field has now
+     * been parsed. 
+     */
+    int T_FIELD = 4;
+    /**
+     * This token indicates, that part headers have now been
+     * parsed.
+     */
+    int T_END_HEADER = 5;
+    /**
+     * This token indicates, that a multipart body is being parsed.
+     */
+    int T_START_MULTIPART = 6;
+    /**
+     * This token indicates, that a multipart body has been parsed.
+     */
+    int T_END_MULTIPART = 7;
+    /**
+     * This token indicates, that a multiparts preamble is being
+     * parsed. 
+     */
+    int T_PREAMBLE = 8;
+    /**
+     * This token indicates, that a multiparts epilogue is being
+     * parsed. 
+     */
+    int T_EPILOGUE = 9;
+    /**
+     * This token indicates, that the MIME stream is currently
+     * at the beginning of a body part.
+     */
+    int T_START_BODYPART = 10;
+    /**
+     * This token indicates, that the MIME stream is currently
+     * at the end of a body part.
+     */
+    int T_END_BODYPART = 11;
+    /**
+     * This token indicates, that an atomic entity is being parsed.
+     */
+    int T_BODY = 12;
+
+}

Propchange: james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/EntityStates.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/Event.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/Event.java?rev=778457&r1=778456&r2=778457&view=diff
==============================================================================
--- james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/Event.java (original)
+++ james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/Event.java Mon May 25 17:20:48 2009
@@ -1,71 +1,71 @@
-/****************************************************************
- * 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.parser;
-
-/**
- * Enumerates events which can be monitored.
- */
-public final class Event { 
-
-    /** Indicates that a body part ended prematurely. */
-    public static final Event MIME_BODY_PREMATURE_END 
-        = new Event("Body part ended prematurely. " +
-                "Boundary detected in header or EOF reached."); 
-    /** Indicates that unexpected end of headers detected.*/
-    public static final Event HEADERS_PREMATURE_END 
-        = new Event("Unexpected end of headers detected. " +
-                "Higher level boundary detected or EOF reached.");
-    /** Indicates that unexpected end of headers detected.*/
-    public static final Event INALID_HEADER 
-        = new Event("Invalid header encountered");
-    
-    private final String code;
-    
-    public Event(final String code) {
-        super();
-        if (code == null) {
-            throw new IllegalArgumentException("Code may not be null");
-        }
-        this.code = code;
-    }
-    
-    @Override
-    public int hashCode() {
-        return code.hashCode();
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (obj == null) return false;
-        if (this == obj) return true;
-        if (obj instanceof Event) {
-            Event that = (Event) obj;
-            return this.code.equals(that.code);
-        } else {
-            return false;
-        }
-    }
-    
-    @Override
-    public String toString() {
-        return code;
-    }
-    
+/****************************************************************
+ * 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.parser;
+
+/**
+ * Enumerates events which can be monitored.
+ */
+public final class Event { 
+
+    /** Indicates that a body part ended prematurely. */
+    public static final Event MIME_BODY_PREMATURE_END 
+        = new Event("Body part ended prematurely. " +
+                "Boundary detected in header or EOF reached."); 
+    /** Indicates that unexpected end of headers detected.*/
+    public static final Event HEADERS_PREMATURE_END 
+        = new Event("Unexpected end of headers detected. " +
+                "Higher level boundary detected or EOF reached.");
+    /** Indicates that unexpected end of headers detected.*/
+    public static final Event INALID_HEADER 
+        = new Event("Invalid header encountered");
+    
+    private final String code;
+    
+    public Event(final String code) {
+        super();
+        if (code == null) {
+            throw new IllegalArgumentException("Code may not be null");
+        }
+        this.code = code;
+    }
+    
+    @Override
+    public int hashCode() {
+        return code.hashCode();
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == null) return false;
+        if (this == obj) return true;
+        if (obj instanceof Event) {
+            Event that = (Event) obj;
+            return this.code.equals(that.code);
+        } else {
+            return false;
+        }
+    }
+    
+    @Override
+    public String toString() {
+        return code;
+    }
+    
 }
\ No newline at end of file

Propchange: james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/Event.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/Field.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/MimeEntity.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/MimeParseEventException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/MimeStreamParser.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/MimeTokenStream.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/RawEntity.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/RawEntity.java?rev=778457&r1=778456&r2=778457&view=diff
==============================================================================
--- james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/RawEntity.java (original)
+++ james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/RawEntity.java Mon May 25 17:20:48 2009
@@ -1,92 +1,92 @@
-/****************************************************************
- * 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.parser;
-
-import org.apache.james.mime4j.descriptor.BodyDescriptor;
-
-import java.io.InputStream;
-
-/**
- * Raw MIME entity. Such entities will not be parsed into elements 
- * by the parser. They are meant to be consumed as a raw data stream
- * by the caller.  
- */
-public class RawEntity implements EntityStateMachine {
-
-    private final InputStream stream;
-
-    private int state;
-    
-    RawEntity(InputStream stream) {
-        this.stream = stream;
-        this.state = EntityStates.T_RAW_ENTITY;
-    }
-    
-    public int getState() {
-        return state;
-    }
-
-    /**
-     * This method has no effect.
-     */
-    public void setRecursionMode(int recursionMode) {
-    }
-
-    public EntityStateMachine advance() {
-        state = EntityStates.T_END_OF_STREAM;
-        return null;
-    }
-    
-    /**
-     * Returns raw data stream.
-     */
-    public InputStream getContentStream() {
-        return stream;
-    }
-
-    /**
-     * This method has no effect and always returns <code>null</code>.
-     */
-    public BodyDescriptor getBodyDescriptor() {
-        return null;
-    }
-
-    /**
-     * This method has no effect and always returns <code>null</code>.
-     */
-    public Field getField() {
-        return null;
-    }
-
-    /**
-     * This method has no effect and always returns <code>null</code>.
-     */
-    public String getFieldName() {
-        return null;
-    }
-
-    /**
-     * This method has no effect and always returns <code>null</code>.
-     */
-    public String getFieldValue() {
-        return null;
-    }
-    
-}
+/****************************************************************
+ * 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.parser;
+
+import org.apache.james.mime4j.descriptor.BodyDescriptor;
+
+import java.io.InputStream;
+
+/**
+ * Raw MIME entity. Such entities will not be parsed into elements 
+ * by the parser. They are meant to be consumed as a raw data stream
+ * by the caller.  
+ */
+public class RawEntity implements EntityStateMachine {
+
+    private final InputStream stream;
+
+    private int state;
+    
+    RawEntity(InputStream stream) {
+        this.stream = stream;
+        this.state = EntityStates.T_RAW_ENTITY;
+    }
+    
+    public int getState() {
+        return state;
+    }
+
+    /**
+     * This method has no effect.
+     */
+    public void setRecursionMode(int recursionMode) {
+    }
+
+    public EntityStateMachine advance() {
+        state = EntityStates.T_END_OF_STREAM;
+        return null;
+    }
+    
+    /**
+     * Returns raw data stream.
+     */
+    public InputStream getContentStream() {
+        return stream;
+    }
+
+    /**
+     * This method has no effect and always returns <code>null</code>.
+     */
+    public BodyDescriptor getBodyDescriptor() {
+        return null;
+    }
+
+    /**
+     * This method has no effect and always returns <code>null</code>.
+     */
+    public Field getField() {
+        return null;
+    }
+
+    /**
+     * This method has no effect and always returns <code>null</code>.
+     */
+    public String getFieldName() {
+        return null;
+    }
+
+    /**
+     * This method has no effect and always returns <code>null</code>.
+     */
+    public String getFieldValue() {
+        return null;
+    }
+    
+}

Propchange: james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/RawEntity.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/RawField.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/RecursionMode.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/RecursionMode.java?rev=778457&r1=778456&r2=778457&view=diff
==============================================================================
--- james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/RecursionMode.java (original)
+++ james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/RecursionMode.java Mon May 25 17:20:48 2009
@@ -1,45 +1,45 @@
-/****************************************************************
- * 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.parser;
-
-/**
- * Enumeration of parsing modes.
- */
-public interface RecursionMode {
-
-    /** 
-     * Recursively parse every <code>message/rfc822</code> part 
-     */
-    int M_RECURSE = 0;
-    /**
-     * Do not recurse <code>message/rfc822</code> parts 
-     */
-    int M_NO_RECURSE = 1;
-    /** 
-     * Parse into raw entities
-     */
-    int M_RAW = 2;
-    /**
-     * Do not recurse <code>message/rfc822</code> parts
-     * and treat multiparts as a single flat body. 
-     */
-    int M_FLAT = 3;
-    
-}
+/****************************************************************
+ * 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.parser;
+
+/**
+ * Enumeration of parsing modes.
+ */
+public interface RecursionMode {
+
+    /** 
+     * Recursively parse every <code>message/rfc822</code> part 
+     */
+    int M_RECURSE = 0;
+    /**
+     * Do not recurse <code>message/rfc822</code> parts 
+     */
+    int M_NO_RECURSE = 1;
+    /** 
+     * Parse into raw entities
+     */
+    int M_RAW = 2;
+    /**
+     * Do not recurse <code>message/rfc822</code> parts
+     * and treat multiparts as a single flat body. 
+     */
+    int M_FLAT = 3;
+    
+}

Propchange: james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/RecursionMode.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/storage/AbstractStorageProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/storage/CipherStorageProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/storage/DefaultStorageProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/storage/MemoryStorageProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/storage/MultiReferenceStorage.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/storage/Storage.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/storage/StorageOutputStream.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/storage/StorageProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/storage/TempFileStorageProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/storage/ThresholdStorageProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/util/ByteArrayBuffer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/util/ByteSequence.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message