X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fws%2Fio%2Fmime%2FJalviewMimeContentHandler.java;h=7d1b0f5cc52c09aebf07c7dd3ee7c1f1d5ab833b;hb=80238b0ded8d29f9f50399c51bc550bc1df9c426;hp=9cbb4d7a16b3b533c4211cffe62b112d0e2d0d67;hpb=6451d24f0987cf8283341750672ba95ee085fc9c;p=jalview.git
diff --git a/src/jalview/ws/io/mime/JalviewMimeContentHandler.java b/src/jalview/ws/io/mime/JalviewMimeContentHandler.java
index 9cbb4d7..7d1b0f5 100644
--- a/src/jalview/ws/io/mime/JalviewMimeContentHandler.java
+++ b/src/jalview/ws/io/mime/JalviewMimeContentHandler.java
@@ -1,3 +1,23 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview. If not, see .
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
package jalview.ws.io.mime;
import jalview.io.packed.DataProvider;
@@ -9,17 +29,17 @@ import java.util.ArrayList;
import java.util.List;
import org.apache.james.mime4j.MimeException;
-import org.apache.james.mime4j.descriptor.BodyDescriptor;
import org.apache.james.mime4j.parser.ContentHandler;
-import org.apache.james.mime4j.parser.Field;
+import org.apache.james.mime4j.stream.BodyDescriptor;
+import org.apache.james.mime4j.stream.Field;
/**
- * ContentHandler for parsing mime encoded messages into Jalview objects.
- * TODO: complete implementation
- * TODO: test implementation
- * TODO: hook in to Jalview IO and service response parser.
+ * ContentHandler for parsing mime encoded messages into Jalview objects. TODO:
+ * complete implementation TODO: test implementation TODO: hook in to Jalview IO
+ * and service response parser.
+ *
* @author JimP
- *
+ *
*/
public class JalviewMimeContentHandler implements ContentHandler
{
@@ -30,117 +50,130 @@ public class JalviewMimeContentHandler implements ContentHandler
/**
* create a new handler to process a Jalview mime message.
+ *
* @param ds
*/
public JalviewMimeContentHandler(JalviewDataset ds)
{
- context=ds;
+ context = ds;
}
+
/**
* type of data pack being parsed currently
*/
String currentType;
+
/**
* name of data pack being parsed currently
*/
String currentName;
-
+
/**
- * sources for data to be parsed
+ * sources for data to be parsed
*/
- List dataItems = new ArrayList();
-
+ List dataItems = new ArrayList<>();
+
@Override
public void body(BodyDescriptor arg0, InputStream arg1)
throws MimeException, IOException
{
-
+
// TODO Auto-generated method stub
-
+
}
@Override
public void endBodyPart() throws MimeException
{
// TODO Auto-generated method stub
-
+
}
@Override
public void endHeader() throws MimeException
{
// TODO Auto-generated method stub
-
+
}
@Override
public void endMessage() throws MimeException
{
// TODO Auto-generated method stub
-
+
}
@Override
public void endMultipart() throws MimeException
{
// TODO Auto-generated method stub
-
+
}
@Override
public void epilogue(InputStream arg0) throws MimeException, IOException
{
// TODO Auto-generated method stub
-
+
}
@Override
public void field(Field arg0) throws MimeException
{
// TODO Auto-generated method stub
-
+
}
@Override
public void preamble(InputStream arg0) throws MimeException, IOException
{
// TODO Auto-generated method stub
-
+
}
@Override
public void raw(InputStream arg0) throws MimeException, IOException
{
// TODO Auto-generated method stub
-
+
}
@Override
public void startBodyPart() throws MimeException
{
// TODO Auto-generated method stub
-
+
}
@Override
public void startHeader() throws MimeException
{
// TODO Auto-generated method stub
-
+
}
@Override
public void startMessage() throws MimeException
{
// TODO Auto-generated method stub
-
+
}
@Override
public void startMultipart(BodyDescriptor arg0) throws MimeException
{
// TODO Auto-generated method stub
-
+
}
+ /**
+ *
+ * @return data providers to parse each data file extracted from the mime
+ * stream.
+ */
+ public Iterable getJalviewDataProviders()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
}