JAL-1432 updated copyright notices
[jalview.git] / src / jalview / ws / io / mime / JalviewMimeContentHandler.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.0b1)
3  * Copyright (C) 2014 The Jalview Authors
4  * 
5  * This file is part of Jalview.
6  * 
7  * Jalview is free software: you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License 
9  * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
10  *  
11  * Jalview is distributed in the hope that it will be useful, but 
12  * WITHOUT ANY WARRANTY; without even the implied warranty 
13  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
14  * PURPOSE.  See the GNU General Public License for more details.
15  * 
16  * You should have received a copy of the GNU General Public License along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
17  * The Jalview Authors are detailed in the 'AUTHORS' file.
18  */
19 package jalview.ws.io.mime;
20
21 import jalview.io.packed.DataProvider;
22 import jalview.io.packed.JalviewDataset;
23
24 import java.io.IOException;
25 import java.io.InputStream;
26 import java.util.ArrayList;
27 import java.util.List;
28
29 import org.apache.james.mime4j.MimeException;
30 import org.apache.james.mime4j.descriptor.BodyDescriptor;
31 import org.apache.james.mime4j.parser.ContentHandler;
32 import org.apache.james.mime4j.parser.Field;
33
34 /**
35  * ContentHandler for parsing mime encoded messages into Jalview objects. TODO:
36  * complete implementation TODO: test implementation TODO: hook in to Jalview IO
37  * and service response parser.
38  * 
39  * @author JimP
40  * 
41  */
42 public class JalviewMimeContentHandler implements ContentHandler
43 {
44   /**
45    * context for data parsed from multi-part mime document
46    */
47   JalviewDataset context;
48
49   /**
50    * create a new handler to process a Jalview mime message.
51    * 
52    * @param ds
53    */
54   public JalviewMimeContentHandler(JalviewDataset ds)
55   {
56     context = ds;
57   }
58
59   /**
60    * type of data pack being parsed currently
61    */
62   String currentType;
63
64   /**
65    * name of data pack being parsed currently
66    */
67   String currentName;
68
69   /**
70    * sources for data to be parsed
71    */
72   List<DataProvider> dataItems = new ArrayList<DataProvider>();
73
74   @Override
75   public void body(BodyDescriptor arg0, InputStream arg1)
76           throws MimeException, IOException
77   {
78
79     // TODO Auto-generated method stub
80
81   }
82
83   @Override
84   public void endBodyPart() throws MimeException
85   {
86     // TODO Auto-generated method stub
87
88   }
89
90   @Override
91   public void endHeader() throws MimeException
92   {
93     // TODO Auto-generated method stub
94
95   }
96
97   @Override
98   public void endMessage() throws MimeException
99   {
100     // TODO Auto-generated method stub
101
102   }
103
104   @Override
105   public void endMultipart() throws MimeException
106   {
107     // TODO Auto-generated method stub
108
109   }
110
111   @Override
112   public void epilogue(InputStream arg0) throws MimeException, IOException
113   {
114     // TODO Auto-generated method stub
115
116   }
117
118   @Override
119   public void field(Field arg0) throws MimeException
120   {
121     // TODO Auto-generated method stub
122
123   }
124
125   @Override
126   public void preamble(InputStream arg0) throws MimeException, IOException
127   {
128     // TODO Auto-generated method stub
129
130   }
131
132   @Override
133   public void raw(InputStream arg0) throws MimeException, IOException
134   {
135     // TODO Auto-generated method stub
136
137   }
138
139   @Override
140   public void startBodyPart() throws MimeException
141   {
142     // TODO Auto-generated method stub
143
144   }
145
146   @Override
147   public void startHeader() throws MimeException
148   {
149     // TODO Auto-generated method stub
150
151   }
152
153   @Override
154   public void startMessage() throws MimeException
155   {
156     // TODO Auto-generated method stub
157
158   }
159
160   @Override
161   public void startMultipart(BodyDescriptor arg0) throws MimeException
162   {
163     // TODO Auto-generated method stub
164
165   }
166
167   /**
168    * 
169    * @return data providers to parse each data file extracted from the mime
170    *         stream.
171    */
172   public Iterable<DataProvider> getJalviewDataProviders()
173   {
174     // TODO Auto-generated method stub
175     return null;
176   }
177
178 }