+ String seprator = System.getProperty("file.separator");
+ String jvTempDir = System.getProperty("java.io.tmpdir") + "jalview"
+ + seprator + System.currentTimeMillis();
+ File tempStructFile = new File(
+ jvTempDir + seprator + fileName + "." + extension);
+ tempStructFile.mkdirs();
+ return tempStructFile.toString();
+ }
+
+ /**
+ *
+ * @param file a File, or a String which is a name of a file
+ * @return
+ * @throws FileNotFoundException
+ */
+ public static BufferedReader getBufferedReader(Object file) throws FileNotFoundException {
+ if (file instanceof String)
+ {
+ return new BufferedReader(new FileReader((String) file));
+ }
+ byte[] bytes = Platform.getFileBytes((File) file);
+ if (bytes != null)
+ {
+ return new BufferedReader(new InputStreamReader(new ByteArrayInputStream(bytes)));
+ }
+ return new BufferedReader(new FileReader((File) file));