You are currently viewing a snapshot of www.mozilla.org taken on April 21, 2008. Most of this content is highly out of date (some pages haven't been updated since the project began in 1998) and exists for historical purposes only. If there are any pages on this archive site that you think should be added back to www.mozilla.org, please file a bug.



All Packages  This Package  Class Hierarchy  Class Search  Index

Class grendel.mime.parser.MimeMultipart

java.lang.Object
   |
   +----grendel.mime.parser.MimeObject
           |
           +----grendel.mime.parser.MimeContainer
                   |
                   +----grendel.mime.parser.MimeMultipart

This class implements the parser for all "multipart/" MIME subtypes.

See Also: MimeMultipartDigest, MimeDwimText, MimeXSunAttachment


class  MimeMultipart
     extends grendel.mime.parser.MimeContainer
{
          // Fields 14
     protected static final int BOUNDARY_NONE;
     protected static final int BOUNDARY_SEPARATOR;
     protected static final int BOUNDARY_TERMINATOR;
     protected static final int MULTIPART_EPILOGUE;
     protected static final int MULTIPART_FIRST_LINE;
     protected static final int MULTIPART_HEADERS;
     protected static final int MULTIPART_LINE;
     protected static final int MULTIPART_PREAMBLE;
     ByteBuf boundary;
     InternetHeaders child_headers;
     ByteBuf crlf;
     ByteLineBuffer line_buffer;
     ByteBuf line_bytes;
     int state;

          // Constructors 1
     public MimeMultipart(String, InternetHeaders);

          // Methods 8
     protected int checkBoundary(ByteBuf);
     protected void computeBoundary();
     protected void createMultipartChild();
     public String defaultSubpartType();
     private void process_line(ByteBuf);
     public void pushBytes(ByteBuf);
     public void pushEOF();
     private void push_child_line(ByteBuf, boolean);
}



Fields


• line_buffer

   ByteLineBuffer line_buffer


• line_bytes

   ByteBuf line_bytes


• boundary

   ByteBuf boundary


• crlf

   ByteBuf crlf


• child_headers

   InternetHeaders child_headers


• state

   int state


• BOUNDARY_NONE

   protected static final int BOUNDARY_NONE


• BOUNDARY_TERMINATOR

   protected static final int BOUNDARY_TERMINATOR


• BOUNDARY_SEPARATOR

   protected static final int BOUNDARY_SEPARATOR


• MULTIPART_PREAMBLE

   protected static final int MULTIPART_PREAMBLE


• MULTIPART_HEADERS

   protected static final int MULTIPART_HEADERS


• MULTIPART_FIRST_LINE

   protected static final int MULTIPART_FIRST_LINE


• MULTIPART_LINE

   protected static final int MULTIPART_LINE


• MULTIPART_EPILOGUE

   protected static final int MULTIPART_EPILOGUE



Constructors


• MimeMultipart

   public MimeMultipart(String content_type, 
                        InternetHeaders headers) 



Methods


• computeBoundary

   protected void computeBoundary() 


• defaultSubpartType

   public String defaultSubpartType() 

When a sub-part doesn't have a content-type specified, this method returns the default type. The default is "text/plain", but, for example, the "multipart/digest" handler overrides this to "message/rfc822". Note that this is a class method.



• pushBytes

   public void pushBytes(ByteBuf bytes) 

Buffers the bytes into lines, and calls process_line() on each line.

Overrides:
pushBytes in class MimeObject


• pushEOF

   public void pushEOF() 

Flushes the line buffer, and (maybe) calls process_line() one last time.

Overrides:
pushEOF in class MimeContainer


• process_line

   private void process_line(ByteBuf line) 

Called for each line of the body of this multipart. Maintains a state machine and decides what the line means.



• checkBoundary

   protected int checkBoundary(ByteBuf line_buf) 


• createMultipartChild

   protected void createMultipartChild() 


• push_child_line

   private void push_child_line(ByteBuf line_buf, 
                                boolean first_line_p) 


All Packages  This Package  Class Hierarchy  Class Search  Index
Freshly brewed Java API Documentation automatically generated with polardoc Version 1.0.4