jar inputstream provider enabling multiple jar entries to be unmarshalled without...
[jalview.git] / src / jalview / util / jarInputStreamProvider.java
1 package jalview.util;\r
2 \r
3 import java.io.IOException;\r
4 import java.util.jar.JarInputStream;\r
5 \r
6 /**\r
7  * input stream provider interface to be implemented\r
8  * by any non-file or URL datasources so that all Jar entries\r
9  * can be read from the datasource by repeatedly re-opening the JarInputStream.\r
10  * \r
11  * This is a workaround necessary because castor's unmarshaller will close the input stream after an unmarshalling session, which normally closes the whole Jar input stream, not just the current JarEntry's stream. \r
12  */\r
13 public interface jarInputStreamProvider {\r
14   /**\r
15    * @return properly initialized jar input stream\r
16    */\r
17   JarInputStream getJarInputStream() throws IOException;\r
18   /**\r
19    * \r
20    * @return human readable name for datasource used when reporting any problems with it\r
21    */\r
22   String getFilename();\r
23 }