You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by ni...@apache.org on 2005/06/07 11:29:43 UTC
svn commit: r188738 - in /james/mime4j/trunk: ./ samples/ samples/org/
samples/org/mime4j/ samples/org/mime4j/samples/
samples/org/mime4j/samples/tree/ xdocs/ xdocs/start/
Author: niklas
Date: Tue Jun 7 02:29:41 2005
New Revision: 188738
URL: http://svn.apache.org/viewcvs?rev=188738&view=rev
Log: (empty)
Added:
james/mime4j/trunk/TODO.txt (with props)
james/mime4j/trunk/maven.xml (with props)
james/mime4j/trunk/project.properties (with props)
james/mime4j/trunk/project.xml (with props)
james/mime4j/trunk/samples/
james/mime4j/trunk/samples/org/
james/mime4j/trunk/samples/org/mime4j/
james/mime4j/trunk/samples/org/mime4j/samples/
james/mime4j/trunk/samples/org/mime4j/samples/tree/
james/mime4j/trunk/samples/org/mime4j/samples/tree/MessageTree.java (with props)
james/mime4j/trunk/xdocs/samples.xml (with props)
james/mime4j/trunk/xdocs/status.xml (with props)
Modified:
james/mime4j/trunk/xdocs/index.xml
james/mime4j/trunk/xdocs/navigation.xml
james/mime4j/trunk/xdocs/start/build.xml
james/mime4j/trunk/xdocs/start/download.xml
james/mime4j/trunk/xdocs/start/index.xml
Added: james/mime4j/trunk/TODO.txt
URL: http://svn.apache.org/viewcvs/james/mime4j/trunk/TODO.txt?rev=188738&view=auto
==============================================================================
--- james/mime4j/trunk/TODO.txt (added)
+++ james/mime4j/trunk/TODO.txt Tue Jun 7 02:29:41 2005
@@ -0,0 +1,4 @@
+Make the DOM-like parser capable of loading bodies (at least large attachment)
+on demand instead of using temporary files.
+
+Remove dependencies on commons-lang and commons-io.
Propchange: james/mime4j/trunk/TODO.txt
------------------------------------------------------------------------------
svn:keywords = Id
Added: james/mime4j/trunk/maven.xml
URL: http://svn.apache.org/viewcvs/james/mime4j/trunk/maven.xml?rev=188738&view=auto
==============================================================================
--- james/mime4j/trunk/maven.xml (added)
+++ james/mime4j/trunk/maven.xml Tue Jun 7 02:29:41 2005
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+/*
+ * Copyright 2004 the mime4j project
+ *
+ * Licensed 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.
+ */
+ -->
+<project default="jar" xmlns:j="jelly:core" xmlns:maven="jelly:maven" xmlns:ant="jelly:ant">
+
+<!-- <goal name="generate-parsers">
+ <j:set var="maven.javacc.javacc.grammar" value="src/java/org/mime4j/field/datetime/DateTimeParser.jj"/>
+ <j:set var="maven.javacc.javacc.package" value="org.mime4j.field.datetime.parser"/>
+ <attainGoal name="javacc:javacc-generate" />
+
+ <j:set var="maven.javacc.javacc.grammar" value="src/java/org/mime4j/field/contenttype/ContentTypeParser.jj"/>
+ <j:set var="maven.javacc.javacc.package" value="org.mime4j.field.contenttype.parser"/>
+ <attainGoal name="javacc:javacc-generate" />
+
+ <j:set var="maven.javacc.jjtree.grammar" value="src/java/org/mime4j/field/address/AddressListParser.jjt"/>
+ <j:set var="maven.javacc.jjtree.package" value="org.mime4j.field.address.parser"/>
+ <attainGoal name="javacc:jjtree-generate" />
+
+ <j:set var="maven.javacc.javacc.grammar" value="src/java/org/mime4j/field/address/parser/AddressListParser.jj"/>
+ <j:set var="maven.javacc.javacc.package" value="org.mime4j.field.address.parser"/>
+ <attainGoal name="javacc:javacc-generate" />
+ </goal>-->
+
+ <postGoal name="dist:prepare-src-filesystem">
+ <mkdir dir="${maven.dist.src.assembly.dir}/testmsgs" />
+ <copy todir="${maven.dist.src.assembly.dir}/testmsgs">
+ <fileset dir="${basedir}/testmsgs">
+ <exclude name="*.mime4j.*"/>
+ </fileset>
+ </copy>
+ </postGoal>
+</project>
Propchange: james/mime4j/trunk/maven.xml
------------------------------------------------------------------------------
svn:keywords = Id
Added: james/mime4j/trunk/project.properties
URL: http://svn.apache.org/viewcvs/james/mime4j/trunk/project.properties?rev=188738&view=auto
==============================================================================
--- james/mime4j/trunk/project.properties (added)
+++ james/mime4j/trunk/project.properties Tue Jun 7 02:29:41 2005
@@ -0,0 +1,30 @@
+#
+# Copyright 2004 the mime4j project
+#
+# Licensed 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.
+#
+
+# GENERAL
+
+# Display the date on the mime4j web site
+maven.xdoc.date = left
+
+# Display the mime4j version the web site is documenting
+maven.xdoc.version = ${pom.currentVersion}
+
+# Links to resolve external Java classes in Javadoc
+maven.javadoc.links = http://java.sun.com/j2se/1.4.2/docs/api/
+
+maven.scm.method = svn
+
+maven.changelog.factory = org.apache.maven.svnlib.SvnChangeLogFactory
Propchange: james/mime4j/trunk/project.properties
------------------------------------------------------------------------------
svn:keywords = Id
Added: james/mime4j/trunk/project.xml
URL: http://svn.apache.org/viewcvs/james/mime4j/trunk/project.xml?rev=188738&view=auto
==============================================================================
--- james/mime4j/trunk/project.xml (added)
+++ james/mime4j/trunk/project.xml Tue Jun 7 02:29:41 2005
@@ -0,0 +1,110 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+/*
+ * Copyright 2004 the mime4j project
+ *
+ * Licensed 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.
+ */
+ -->
+<project>
+ <pomVersion>3</pomVersion>
+ <name>mime4j</name>
+ <id>mime4j</id>
+ <currentVersion>0.2-SNAPSHOT</currentVersion>
+<!-- <organization>
+ <name>sourceforge</name>
+ <url>http://sourceforge.net/</url>
+ <logo>http://sourceforge.net/sflogo.php?group_id=108895&type=1</logo>
+ </organization>-->
+ <inceptionYear>2004</inceptionYear>
+ <package>org.mime4j</package>
+ <shortDescription>Java stream based MIME message parser</shortDescription>
+ <description>
+ </description>
+ <url>http://www.mime4j.org/</url>
+ <issueTrackingUrl>
+ http://sourceforge.net/tracker/?group_id=108895&atid=654176
+ </issueTrackingUrl>
+ <siteAddress>www.mime4j.org</siteAddress>
+ <repository>
+ <connection>scm:svn:https://svn.apache.org/repos/asf/james/mime4j/trunk/</connection>
+ <developerConnection>scm:svn:https://svn.apache.org/repos/asf/james/mime4j/trunk/</developerConnection>
+ <url>http://svn.apache.org/viewcvs.cgi/james/mime4j/trunk/</url>
+ </repository>
+ <versions>
+ <version>
+ <id>0.2-SNAPSHOT</id>
+ <name>0.2-SNAPSHOT</name>
+ <tag>HEAD</tag>
+ </version>
+ </versions>
+<!-- <mailingLists>
+ <mailingList>
+ <name>mime4j developer list</name>
+ <subscribe>http://lists.sourceforge.net/lists/listinfo/mime4j-developer</subscribe>
+ <unsubscribe>http://lists.sourceforge.net/lists/listinfo/mime4j-developer</unsubscribe>
+ </mailingList>
+ </mailingLists>-->
+ <developers>
+ <developer>
+ <name>Niklas Therning</name>
+ <id>ntherning</id>
+ <email>niklas(at)trillian(dot)se</email>
+ <organization>Trillian AB</organization>
+ </developer>
+ <developer>
+ <name>Joe Cheng</name>
+ <id>jcheng</id>
+ <email>code(at)joecheng(dot)com</email>
+ <organization></organization>
+ </developer>
+ </developers>
+ <dependencies>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.0.4</version>
+ <url>http://jakarta.apache.org/commons/logging</url>
+ </dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>1.0</version>
+ <url>http://jakarta.apache.org/commons/io</url>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.8</version>
+ <url>http://logging.apache.org/log4j</url>
+ </dependency>
+ </dependencies>
+ <build>
+ <sourceDirectory>src/java</sourceDirectory>
+ <unitTestSourceDirectory>src/test</unitTestSourceDirectory>
+ <aspectSourceDirectory/>
+ <!-- Unit test cases -->
+ <unitTest>
+ <includes>
+ <include>**/*Test.java</include>
+ </includes>
+ <excludes>
+ <exclude>**/RepositoryTest.java</exclude>
+ </excludes>
+ </unitTest>
+ <!-- Integration unit test cases -->
+ <integrationUnitTest/>
+ <jars>
+ </jars>
+ </build>
+</project>
Propchange: james/mime4j/trunk/project.xml
------------------------------------------------------------------------------
svn:keywords = Id
Added: james/mime4j/trunk/samples/org/mime4j/samples/tree/MessageTree.java
URL: http://svn.apache.org/viewcvs/james/mime4j/trunk/samples/org/mime4j/samples/tree/MessageTree.java?rev=188738&view=auto
==============================================================================
--- james/mime4j/trunk/samples/org/mime4j/samples/tree/MessageTree.java (added)
+++ james/mime4j/trunk/samples/org/mime4j/samples/tree/MessageTree.java Tue Jun 7 02:29:41 2005
@@ -0,0 +1,371 @@
+package org.mime4j.samples.tree;
+
+import java.awt.Dimension;
+import java.awt.GridLayout;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Reader;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.swing.JFrame;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JSplitPane;
+import javax.swing.JTextArea;
+import javax.swing.JTree;
+import javax.swing.event.TreeSelectionEvent;
+import javax.swing.event.TreeSelectionListener;
+import javax.swing.tree.DefaultMutableTreeNode;
+import javax.swing.tree.TreeSelectionModel;
+
+import org.mime4j.field.AddressListField;
+import org.mime4j.field.ContentTypeField;
+import org.mime4j.field.DateTimeField;
+import org.mime4j.field.Field;
+import org.mime4j.field.UnstructuredField;
+import org.mime4j.field.address.Mailbox;
+import org.mime4j.field.address.MailboxList;
+import org.mime4j.message.BinaryBody;
+import org.mime4j.message.Body;
+import org.mime4j.message.BodyPart;
+import org.mime4j.message.Entity;
+import org.mime4j.message.Header;
+import org.mime4j.message.Message;
+import org.mime4j.message.Multipart;
+import org.mime4j.message.TextBody;
+
+/**
+ * Displays a parsed Message in a window. The window will be divided into
+ * two panels. The left panel displays the Message tree. Clicking on a
+ * node in the tree shows information on that node in the right panel.
+ *
+ * Some of this code have been copied from the Java tutorial's JTree section.
+ *
+ * @author Niklas Therning
+ * @version $Id$
+ */
+public class MessageTree extends JPanel implements TreeSelectionListener {
+ private JPanel contentPane;
+ private JTextArea textView;
+ private JTree tree;
+
+ /**
+ * Wraps an Object and associates it with a text. All message parts
+ * (headers, bodies, multiparts, body parts) will be wrapped in
+ * ObjectWrapper instances before they are added to the JTree instance.
+ */
+ public static class ObjectWrapper {
+ private String text = "";
+ private Object object = null;
+
+ public ObjectWrapper(String text, Object object) {
+ this.text = text;
+ this.object = object;
+ }
+
+ public String toString() {
+ return text;
+ }
+
+ public Object getObject() {
+ return object;
+ }
+ }
+
+ /**
+ * Creates a new <code>MessageTree</code> instance displaying the
+ * specified <code>Message</code>.
+ *
+ * @param message the message to display.
+ */
+ public MessageTree(Message message) {
+ super(new GridLayout(1,0));
+
+ DefaultMutableTreeNode root = createNode(message);
+
+ tree = new JTree(root);
+ tree.getSelectionModel().setSelectionMode(
+ TreeSelectionModel.SINGLE_TREE_SELECTION);
+
+ tree.addTreeSelectionListener(this);
+
+ JScrollPane treeView = new JScrollPane(tree);
+
+ contentPane = new JPanel(new GridLayout(1,0));
+ JScrollPane contentView = new JScrollPane(contentPane);
+
+ JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
+ splitPane.setLeftComponent(treeView);
+ splitPane.setRightComponent(contentView);
+
+ Dimension minimumSize = new Dimension(100, 50);
+ contentView.setMinimumSize(minimumSize);
+ treeView.setMinimumSize(minimumSize);
+ splitPane.setDividerLocation(250);
+ splitPane.setPreferredSize(new Dimension(750, 500));
+
+ add(splitPane);
+
+ textView = new JTextArea();
+ textView.setEditable(false);
+ textView.setLineWrap(true);
+ contentPane.add(textView);
+ }
+
+ /**
+ * Create a node given a Multipart body.
+ * Add the Preamble, all Body parts and the Epilogue to the node.
+ *
+ * @param multipart the Multipart.
+ * @return the root node of the tree.
+ */
+ private DefaultMutableTreeNode createNode(Header header) {
+ DefaultMutableTreeNode node = new DefaultMutableTreeNode(
+ new ObjectWrapper("Header", header));
+
+ for (Iterator it = header.getFields().iterator(); it.hasNext();) {
+ Field field = (Field) it.next();
+ String name = field.getName();
+
+ node.add(new DefaultMutableTreeNode(new ObjectWrapper(name, field)));
+ }
+
+ return node;
+ }
+
+ /**
+ * Create a node given a Multipart body.
+ * Add the Preamble, all Body parts and the Epilogue to the node.
+ *
+ * @param multipart the Multipart.
+ * @return the root node of the tree.
+ */
+ private DefaultMutableTreeNode createNode(Multipart multipart) {
+ DefaultMutableTreeNode node = new DefaultMutableTreeNode(
+ new ObjectWrapper("Multipart", multipart));
+
+ node.add(new DefaultMutableTreeNode(
+ new ObjectWrapper("Preamble", multipart.getPreamble())));
+ for (Iterator it = multipart.getBodyParts().iterator(); it.hasNext();) {
+ BodyPart part = (BodyPart) it.next();
+ node.add(createNode(part));
+ }
+ node.add(new DefaultMutableTreeNode(
+ new ObjectWrapper("Epilogue", multipart.getEpilogue())));
+
+ return node;
+ }
+
+ /**
+ * Creates the tree nodes given a MIME entity (either a Message or
+ * a BodyPart).
+ *
+ * @param entity the entity.
+ * @return the root node of the tree displaying the specified entity and
+ * its children.
+ */
+ private DefaultMutableTreeNode createNode(Entity entity) {
+
+ /*
+ * Create the root node for the entity. It's either a
+ * Message or a Body part.
+ */
+ String type = "Message";
+ if (entity instanceof BodyPart) {
+ type = "Body part";
+ }
+ DefaultMutableTreeNode node = new DefaultMutableTreeNode(
+ new ObjectWrapper(type, entity));
+
+ /*
+ * Add the node encapsulating the entity Header.
+ */
+ node.add(createNode(entity.getHeader()));
+
+ Body body = entity.getBody();
+
+ if (body instanceof Multipart) {
+ /*
+ * The body of the entity is a Multipart.
+ */
+
+ node.add(createNode((Multipart) body));
+ } else if (body instanceof Message) {
+ /*
+ * The body is another Message.
+ */
+
+ node.add(createNode((Message) body));
+
+ } else {
+ /*
+ * Discrete Body (either of type TextBody or BinaryBody).
+ */
+ type = "Text body";
+ if (body instanceof BinaryBody) {
+ type = "Binary body";
+ }
+
+ type += " (" + entity.getMimeType() + ")";
+ node.add(new DefaultMutableTreeNode(new ObjectWrapper(type, body)));
+
+ }
+
+ return node;
+ }
+
+ /**
+ * Called whenever the selection changes in the JTree instance showing
+ * the Message nodes.
+ *
+ * @param e the event.
+ */
+ public void valueChanged(TreeSelectionEvent e) {
+ DefaultMutableTreeNode node = (DefaultMutableTreeNode)
+ tree.getLastSelectedPathComponent();
+
+ textView.setText("");
+
+ if (node == null) {
+ return;
+ }
+
+ Object o = ((ObjectWrapper) node.getUserObject()).getObject();
+
+ if (node.isLeaf()) {
+
+ if (o instanceof TextBody){
+ /*
+ * A text body. Display its contents.
+ */
+ TextBody body = (TextBody) o;
+ StringBuffer sb = new StringBuffer();
+ try {
+ Reader r = body.getReader();
+ int c;
+ while ((c = r.read()) != -1) {
+ sb.append((char) c);
+ }
+ } catch (IOException ex) {
+ ex.printStackTrace();
+ }
+ textView.setText(sb.toString());
+
+ } else if (o instanceof BinaryBody){
+ /*
+ * A binary body. Display its MIME type and length in bytes.
+ */
+ BinaryBody body = (BinaryBody) o;
+ int size = 0;
+ try {
+ InputStream is = body.getInputStream();
+ int b;
+ while ((b = is.read()) != -1) {
+ size++;
+ }
+ } catch (IOException ex) {
+ ex.printStackTrace();
+ }
+ textView.setText("Binary body\n"
+ + "MIME type: "
+ + body.getParent().getMimeType() + "\n"
+ + "Size of decoded data: " + size + " bytes");
+
+ } else if (o instanceof ContentTypeField) {
+ /*
+ * Content-Type field.
+ */
+ ContentTypeField field = (ContentTypeField) o;
+ StringBuffer sb = new StringBuffer();
+ sb.append("MIME type: " + field.getMimeType() + "\n");
+ Map params = field.getParameters();
+ for (Iterator it = params.keySet().iterator(); it.hasNext();) {
+ String name = (String) it.next();
+ sb.append(name + " = " + params.get(name) + "\n");
+ }
+ textView.setText(sb.toString());
+
+ } else if (o instanceof AddressListField) {
+ /*
+ * An address field (From, To, Cc, etc)
+ */
+ AddressListField field = (AddressListField) o;
+ MailboxList list = field.getAddressList().flatten();
+ StringBuffer sb = new StringBuffer();
+ for (int i = 0; i < list.size(); i++) {
+ Mailbox mb = list.get(i);
+ sb.append(mb.getAddressString() + "\n");
+ }
+ textView.setText(sb.toString());
+
+ } else if (o instanceof DateTimeField) {
+ Date date = ((DateTimeField) o).getDate();
+ textView.setText(date.toString());
+ } else if (o instanceof UnstructuredField){
+ textView.setText(((UnstructuredField) o).getValue());
+ } else if (o instanceof Field){
+ textView.setText(((Field) o).getBody());
+ } else {
+ /*
+ * The Object should be a Header or a String containing a
+ * Preamble or Epilogue.
+ */
+ textView.setText(o.toString());
+ }
+
+ }
+ }
+
+ /**
+ * Creates and displays the gui.
+ *
+ * @param message the Message to display in the tree.
+ */
+ private static void createAndShowGUI(Message message) {
+ /*
+ * Create and set up the window.
+ */
+ JFrame frame = new JFrame("MessageTree");
+ frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+
+ /*
+ * Create and set up the content pane.
+ */
+ MessageTree newContentPane = new MessageTree(message);
+ newContentPane.setOpaque(true);
+ frame.setContentPane(newContentPane);
+
+ /*
+ * Display the window.
+ */
+ frame.pack();
+ frame.setVisible(true);
+ }
+
+ public static void main(String[] args) {
+ try {
+
+ final Message message = new Message(new FileInputStream(args[0]));
+
+ javax.swing.SwingUtilities.invokeLater(new Runnable() {
+ public void run() {
+ createAndShowGUI(message);
+ }
+ });
+
+ } catch (ArrayIndexOutOfBoundsException e) {
+ System.err.println("Wrong number of arguments.");
+ System.err.println("Usage: org.mime4j.samples.tree.MessageTree"
+ + " path/to/message");
+ } catch (FileNotFoundException e) {
+ System.err.println("The file '" + args[0] + "' could not be found.");
+ } catch (IOException e) {
+ System.err.println("The file '" + args[0] + "' could not be read.");
+ }
+ }
+
+}
Propchange: james/mime4j/trunk/samples/org/mime4j/samples/tree/MessageTree.java
------------------------------------------------------------------------------
svn:keywords = Id
Modified: james/mime4j/trunk/xdocs/index.xml
URL: http://svn.apache.org/viewcvs/james/mime4j/trunk/xdocs/index.xml?rev=188738&r1=188737&r2=188738&view=diff
==============================================================================
--- james/mime4j/trunk/xdocs/index.xml (original)
+++ james/mime4j/trunk/xdocs/index.xml Tue Jun 7 02:29:41 2005
@@ -1,62 +1,68 @@
-<?xml version="1.0"?>
-<!--
-/*
- * Copyright 2004 Trillian AB
- *
- * Licensed 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.
- */
- -->
-<document>
- <properties>
- <title>Mime4j</title>
- </properties>
- <body>
- <section name="Mime4j">
- <p> mime4j provides a parser,
- <a href="apidocs/org/mime4j/MimeStreamParser.html">
- <code>MimeStreamParser</code>
- </a>, for e-mail message streams in plain rfc822 format or MIME
- format. The parser uses a callback mechanism to report parsing
- events such as the start of an entity header, the start of a
- body, etc. If you are familiar to how one uses <a
- href="http://www.saxproject.org/">SAX</a> to parse XML streams
- you should have no problem getting started with mime4j. </p>
- <p> The parser only deals with the structure of the message stream.
- It won't do any decoding of base64 or quoted-printable encoded
- header fields and bodies. This is intentional - the parser
- should only provide the most basic functionality needed to build
- more complex parsers. However, mime4j does include facilities to
- decode bodies and fields and the <code>Message</code> class
- described below handles decoding of fields and bodies
- transparently. </p>
- <p> The parser has been designed to be extremely tolerant against
- messages violating the standards. It has been tested using a
- large corpus (>5000) of e-mail messages. As a benchmark
- the widely used perl <a
- href="http://www.zeegee.com/code/perl/MIME-tools/">MIME::Tools</a>
- parser has been used. mime4j and MIME:Tools rarely differ
- (<25 in those 5000). When they do (which mostly happens
- with illegally formatted spam messages) we think mime4j does a
- better job. </p>
- <p> mime4j can also be used to build a tree representation of an
- e-mail message using the
- <a href="apidocs/org/mime4j/message/Message.html">
- <code>Message</code>
- </a>. Using this facility mime4j automatically handles the
- decoding of fields and bodies and uses temporary files for large
- attachments. This representation is similar to the
- representation constructed by the JavaMail API:s but is more
- tolerant to messages violating the standards. </p>
- </section>
- </body>
-</document>
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+/*
+ * Copyright 2004 the mime4j project
+ *
+ * Licensed 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.
+ */
+ -->
+<document>
+ <properties>
+ <title>Mime4j</title>
+ </properties>
+ <body>
+ <section name="Mime4j">
+ <p>
+ <strong>NOTE:</strong> mime4j is now a subproject of
+ <a href="http://james.apache.org/">Apache James</a>. Please use
+ the James mailing list for mime4j related questions. Downloads
+ will still be available from the sourceforge project page.
+ </p>
+ <p> mime4j provides a parser,
+ <a href="apidocs/org/mime4j/MimeStreamParser.html">
+ <code>MimeStreamParser</code>
+ </a>, for e-mail message streams in plain rfc822 and MIME
+ format. The parser uses a callback mechanism to report parsing
+ events such as the start of an entity header, the start of a
+ body, etc. If you are familiar with the <a
+ href="http://www.saxproject.org/">SAX</a> XML parser interface
+ you should have no problem getting started with mime4j. </p>
+ <p> The parser only deals with the structure of the message stream.
+ It won't do any decoding of base64 or quoted-printable encoded
+ header fields and bodies. This is intentional - the parser
+ should only provide the most basic functionality needed to build
+ more complex parsers. However, mime4j does include facilities to
+ decode bodies and fields and the <code>Message</code> class
+ described below handles decoding of fields and bodies
+ transparently. </p>
+ <p> The parser has been designed to be extremely tolerant against
+ messages violating the standards. It has been tested using a
+ large corpus (>5000) of e-mail messages. As a benchmark
+ the widely used perl <a
+ href="http://www.zeegee.com/code/perl/MIME-tools/">MIME::Tools</a>
+ parser has been used. mime4j and MIME:Tools rarely differ
+ (<25 in those 5000). When they do (which only occurs
+ for illegally formatted spam messages) we think mime4j does a
+ better job. </p>
+ <p> mime4j can also be used to build a tree representation of an
+ e-mail message using the
+ <a href="apidocs/org/mime4j/message/Message.html">
+ <code>Message</code>
+ </a> class. Using this facility mime4j automatically handles the
+ decoding of fields and bodies and uses temporary files for large
+ attachments. This representation is similar to the
+ representation constructed by the JavaMail API:s but is more
+ tolerant to messages violating the standards. </p>
+ </section>
+ </body>
+</document>
Modified: james/mime4j/trunk/xdocs/navigation.xml
URL: http://svn.apache.org/viewcvs/james/mime4j/trunk/xdocs/navigation.xml?rev=188738&r1=188737&r2=188738&view=diff
==============================================================================
--- james/mime4j/trunk/xdocs/navigation.xml (original)
+++ james/mime4j/trunk/xdocs/navigation.xml Tue Jun 7 02:29:41 2005
@@ -1,41 +1,45 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-/*
- * Copyright 2004 Trillian AB
- *
- * Licensed 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.
- */
- -->
-<project name="mime4j">
- <title>mime4j</title>
- <body>
- <menu name="Quick Links">
- <item name="Download" href="http://sourceforge.net/project/showfiles.php?group_id=108895"/>
- <item name="Forums" href="http://sourceforge.net/forum/?group_id=108895"/>
- <item name="Mailing Lists" href="http://sourceforge.net/mail/?group_id=108895"/>
- <item name="SourceForge project page" href="http://sourceforge.net/projects/mime4j/"/>
- </menu>
- <menu name="Overview">
- <item name="Features" href="/features.html"/>
- <item name="News and Status" href="/status.html"/>
- <item name="Getting Started" href="/start/index.html" collapse="true">
- <item name="Download" href="/start/download.html"/>
- <item name="Build" href="/start/build.html"/>
- </item>
- </menu>
- <menu name="Documentation">
- <item name="Tutorial" href="/start/use.html"/>
- <item name="API docs (Javadoc)" href="/apidocs/"/>
- </menu>
- </body>
-</project>
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+/*
+ * Copyright 2004 the mime4j project
+ *
+ * Licensed 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.
+ */
+ -->
+<project name="mime4j">
+ <title>mime4j - the Java stream based MIME message parser</title>
+ <body>
+ <links>
+ <item name="Home Page" href="http://www.mime4j.org/"/>
+ <item name="SourceForge Project Page" href="http://sourceforge.net/projects/mime4j/"/>
+ <item name="Browse Source Code" href="http://svn.apache.org/viewcvs.cgi/james/mime4j/trunk/"/>
+ </links>
+ <menu name="Quick Links">
+ <item name="Download" href="http://sourceforge.net/project/showfiles.php?group_id=108895"/>
+ <!--<item name="Forums" href="http://sourceforge.net/forum/?group_id=108895"/>-->
+ <!--<item name="Mailing Lists" href="http://sourceforge.net/mail/?group_id=108895"/>-->
+ </menu>
+ <menu name="Overview">
+ <!--<item name="Features" href="/features.html"/>-->
+ <item name="News and Status" href="/status.html"/>
+ <item name="Getting Started" href="/start/index.html" collapse="true">
+ <item name="Download" href="/start/download.html"/>
+ <item name="Build" href="/start/build.html"/>
+ </item>
+ </menu>
+ <menu name="Documentation">
+<!-- <item name="Samples" href="/samples.html"/>-->
+ <item name="API docs (Javadoc)" href="/apidocs/"/>
+ </menu>
+ </body>
+</project>
Added: james/mime4j/trunk/xdocs/samples.xml
URL: http://svn.apache.org/viewcvs/james/mime4j/trunk/xdocs/samples.xml?rev=188738&view=auto
==============================================================================
--- james/mime4j/trunk/xdocs/samples.xml (added)
+++ james/mime4j/trunk/xdocs/samples.xml Tue Jun 7 02:29:41 2005
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+/*
+ * Copyright 2004 the mime4j project
+ *
+ * Licensed 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.
+ */
+ -->
+<document>
+ <properties>
+ <title>Samples</title>
+ </properties>
+ <body>
+ <section name="Samples">
+ <p>
+ The mime4j distribution includes a number of sample applications
+ which demonstrate how the library could be used. This section
+ gives you a short review of those samples. For more information
+ you should download the distribution and study the sample sources.
+ The samples are in in <code>samples/</code> sub-directory.
+ </p>
+ <table>
+ <tr>
+ <th>Sample</th>
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td>
+ <code>org.mime4j.samples.tree.MessageTree</code>
+ </td>
+ <td>Displays a tree of the contents of a
+ mime4j <code>Message</code> object in a Swing GUI.
+ To try it out run
+ <blockquote>
+ <code>java org.mime4j.samples.tree.MessageTree path/to/message.msg</code>
+ </blockquote>
+ The output is very useful if
+ you want the study the structure of MIME messages.
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code>org.mime4j.samples.sax.Mime2Sax</code>
+ </td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>
+ <code>org.mime4j.samples.pgp.PGPSignatureVerifier</code>
+ </td>
+ <td></td>
+ </tr>
+ </table>
+ </section>
+ </body>
+</document>
Propchange: james/mime4j/trunk/xdocs/samples.xml
------------------------------------------------------------------------------
svn:executable = *
Propchange: james/mime4j/trunk/xdocs/samples.xml
------------------------------------------------------------------------------
svn:keywords = Id
Modified: james/mime4j/trunk/xdocs/start/build.xml
URL: http://svn.apache.org/viewcvs/james/mime4j/trunk/xdocs/start/build.xml?rev=188738&r1=188737&r2=188738&view=diff
==============================================================================
--- james/mime4j/trunk/xdocs/start/build.xml (original)
+++ james/mime4j/trunk/xdocs/start/build.xml Tue Jun 7 02:29:41 2005
@@ -1,80 +1,77 @@
-<?xml version="1.0"?>
-<!--
-/*
- * Copyright 2004 Trillian AB
- *
- * Licensed 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.
- */
- -->
-<document>
- <properties>
- <title>Building mime4j</title>
- </properties>
- <body>
- <section name="Building mime4j">
- <subsection name="Getting the sources">
- <subsection name="Using a stable release">
- <p> Go to the <a
- href="http://sourceforge.net/project/showfiles.php?group_id=108895">
- Sourceforge download pages</a> and download the most
- recent release in your prefered format, either
- <code>mime4j-x.y-src.tar.gz</code> or
- <code>mime4j-x.y-src.zip</code>. Extracting the archived
- sources will create the directory <code>mime4j-x.y/</code>
- </p>
- </subsection>
- <subsection name="Checking out from CVS">
- <p>
- <strong>If you </strong>
- </p>
- <p> The <a
- href="http://sourceforge.net/tracker/?group_id=108895&atid=654176">
- Sourceforge CVS pages</a> has more information on
- how to checkout the sources from the CVS repository. </p>
- </subsection>
- </subsection>
- <subsection name="Download and install Maven">
- <p> You will need to download and install <a
- href="http://maven.apache.org/">Maven</a> before building
- the sources. The build has been tested with version 1.0 of
- Maven so use this or a later version if possible. </p>
- <p> One of the main differences between Maven and plain ant is
- that Maven manages external dependencies for your projects
- and (at least in theory) you should no longer have to store
- third-party jar files in your CVS tree. It maintains a local
- repository of versioned libraries and shares them between
- your Maven projects. If it can't find the necessary files
- there it will attempt to download them from the main Maven
- repository at www.ibiblio.org/maven. So to use the Maven
- build, you need to have a network connection available for
- the inital download of the project dependencies. </p>
- </subsection>
- <subsection name="Building the mime4j jar">
- <p> Once Maven has been installed, building the project should
- be as simple as typing <blockquote>
- <code>cd mime4j-x.y/ (cd mime4j/ if sources come from
- CVS)<br/>maven jar</code>
- </blockquote> from the command line. Maven will
- automatically run all test cases for you. If you want to
- disable the tests you should replace the last command above
- with <blockquote>
- <code>maven -Dmaven.test.skip=true jar</code>
- </blockquote> Maven will create the
- <code>mime4j-x.y.jar</code> jar file in the
- <code>target</code> directory. For more information on using
- Maven, have a look at the <a
- href="http://maven.apache.org/">Maven web site</a>. </p>
- </subsection>
- </section>
- </body>
-</document>
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+/*
+ * Copyright 2004 the mime4j project
+ *
+ * Licensed 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.
+ */
+ -->
+<document>
+ <properties>
+ <title>Building mime4j</title>
+ </properties>
+ <body>
+ <section name="Building mime4j">
+ <subsection name="Using a Stable Release">
+ <p> Go to the <a
+ href="http://sourceforge.net/project/showfiles.php?group_id=108895">
+ Sourceforge download pages</a> and download the most
+ recent release in your preferred format, either
+ <code>mime4j-x.y-src.tar.gz</code> or
+ <code>mime4j-x.y-src.zip</code>. Extracting the archived
+ sources will create the directory <code>mime4j-x.y/</code>
+ </p>
+ </subsection>
+ <subsection name="Checking Out From Subversion">
+ <p>
+ Issue the following commands in a shell:
+ <blockquote>
+ <code>svn co 'https://svn.apache.org/repos/asf/james/mime4j/trunk/' mime4j</code><br/>
+ </blockquote>
+ </p>
+ </subsection>
+ <subsection name="Download and Install Maven">
+ <p> You will need to download and install <a
+ href="http://maven.apache.org/">Maven</a> before building
+ the sources. The build has been tested with version 1.0 of
+ Maven so use this or a later version if possible. </p>
+ <p> One of the main differences between Maven and plain ant is
+ that Maven manages external dependencies for your projects
+ and (at least in theory) you should no longer have to store
+ third-party jar files in your source code tree. It maintains a local
+ repository of versioned libraries and shares them between
+ your Maven projects. If it can't find the necessary files
+ there it will attempt to download them from the main Maven
+ repository at www.ibiblio.org/maven. So to use the Maven
+ build, you need to have a network connection available for
+ the inital download of the project dependencies. </p>
+ </subsection>
+ <subsection name="Building the mime4j Jar">
+ <p> Once Maven has been installed, building the project should
+ be as simple as typing <blockquote>
+ <code>cd mime4j-x.y/ (cd mime4j/ if sources come from
+ Subversion)<br/>maven jar</code>
+ </blockquote> from the command line. Maven will
+ automatically run all test cases for you. If you want to
+ disable the tests you should replace the last command above
+ with <blockquote>
+ <code>maven -Dmaven.test.skip=true jar</code>
+ </blockquote> Maven will create the
+ <code>mime4j-x.y.jar</code> jar file in the
+ <code>target</code> directory. For more information on using
+ Maven, have a look at the <a
+ href="http://maven.apache.org/">Maven web site</a>. </p>
+ </subsection>
+ </section>
+ </body>
+</document>
Modified: james/mime4j/trunk/xdocs/start/download.xml
URL: http://svn.apache.org/viewcvs/james/mime4j/trunk/xdocs/start/download.xml?rev=188738&r1=188737&r2=188738&view=diff
==============================================================================
--- james/mime4j/trunk/xdocs/start/download.xml (original)
+++ james/mime4j/trunk/xdocs/start/download.xml Tue Jun 7 02:29:41 2005
@@ -1,35 +1,35 @@
-<?xml version="1.0"?>
-<!--
-/*
- * Copyright 2004 Trillian AB
- *
- * Licensed 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.
- */
- -->
-<document>
- <properties>
- <title>Downloading mime4j</title>
- </properties>
- <body>
- <section name="Downloading mime4j">
- <p> Go to the <a
- href="http://sourceforge.net/project/showfiles.php?group_id=108895">
- Sourceforge download pages</a> and download the most recent
- release in your prefered format, either
- <code>mime4j-x.y.tar.gz</code> or <code>mime4j-x.y.zip</code>.
- Extracting the archived sources will create the directory
- <code>mime4j-x.y/</code> which contains the mime4j jar file and
- the API docs.</p>
- </section>
- </body>
-</document>
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+/*
+ * Copyright 2004 the mime4j project
+ *
+ * Licensed 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.
+ */
+ -->
+<document>
+ <properties>
+ <title>Downloading mime4j</title>
+ </properties>
+ <body>
+ <section name="Downloading mime4j">
+ <p> Go to the <a
+ href="http://sourceforge.net/project/showfiles.php?group_id=108895">
+ Sourceforge download pages</a> and download the most recent
+ release in your preferred format, either
+ <code>mime4j-x.y.tar.gz</code> or <code>mime4j-x.y.zip</code>.
+ Extracting the archived sources will create the directory
+ <code>mime4j-x.y/</code> which contains the mime4j jar file and
+ the API docs.</p>
+ </section>
+ </body>
+</document>
Modified: james/mime4j/trunk/xdocs/start/index.xml
URL: http://svn.apache.org/viewcvs/james/mime4j/trunk/xdocs/start/index.xml?rev=188738&r1=188737&r2=188738&view=diff
==============================================================================
--- james/mime4j/trunk/xdocs/start/index.xml (original)
+++ james/mime4j/trunk/xdocs/start/index.xml Tue Jun 7 02:29:41 2005
@@ -1,26 +1,53 @@
-<?xml version="1.0"?>
-<document>
-
- <properties>
- <title>Getting Started with mime4j</title>
- </properties>
-
- <body>
- <section name="Getting Started with mime4j">
-
- <subsection name="Overview of the Getting Started Documentation">
- <table>
- <tr><th>Document</th><th>Description</th></tr>
- <tr><td><a href="download.html">Download</a></td>
- <td>
- Before you can start using mime4j, you'll have
- to download the distribution to your system (unless
- you plan on building the project from source). This document
- provides links to the various distributions available.
- </td>
- </tr>
- </table>
- </subsection>
- </section>
- </body>
-</document>
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+/*
+ * Copyright 2004 the mime4j project
+ *
+ * Licensed 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.
+ */
+ -->
+<document>
+ <properties>
+ <title>Getting Started with mime4j</title>
+ </properties>
+ <body>
+ <section name="Getting Started with mime4j">
+ <subsection name="Overview of the Getting Started Documentation">
+ <table>
+ <tr>
+ <th>Document</th>
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td>
+ <a href="download.html">Download</a>
+ </td>
+ <td> Before you can start using mime4j, you'll have to
+ download the distribution to your system (unless you
+ plan on building the project from source). This
+ document provides links to the various distributions
+ available. </td>
+ </tr>
+ <tr>
+ <td>
+ <a href="build.html">Building mime4j</a>
+ </td>
+ <td>
+ Describes how to build mime4j from the sources.
+ </td>
+ </tr>
+ </table>
+ </subsection>
+ </section>
+ </body>
+</document>
Added: james/mime4j/trunk/xdocs/status.xml
URL: http://svn.apache.org/viewcvs/james/mime4j/trunk/xdocs/status.xml?rev=188738&view=auto
==============================================================================
--- james/mime4j/trunk/xdocs/status.xml (added)
+++ james/mime4j/trunk/xdocs/status.xml Tue Jun 7 02:29:41 2005
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+/*
+ * Copyright 2004 the mime4j project
+ *
+ * Licensed 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.
+ */
+ -->
+<document>
+ <properties>
+ <title>News and Status</title>
+ </properties>
+ <body>
+ <section name="News and Status">
+ <subsection name="News">
+ <p>
+ mime4j is now a subproject of
+ <a href="http://james.apache.org/">Apache James</a>.
+ </p>
+ </subsection>
+ <subsection name="Current Status">
+ <p> The next release will be version 0.2. </p>
+ </subsection>
+ </section>
+ </body>
+</document>
Propchange: james/mime4j/trunk/xdocs/status.xml
------------------------------------------------------------------------------
svn:executable = *
Propchange: james/mime4j/trunk/xdocs/status.xml
------------------------------------------------------------------------------
svn:keywords = Id
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org