\r
String loadPDBFile(String file, String pdbId)\r
{\r
+ System.out.println("load file "+file);\r
try\r
{\r
JarInputStream jin = null;\r
}\r
while (!entry.getName().equals(pdbId));\r
\r
- DataInputStream in = new DataInputStream(jin);\r
+ BufferedReader in = new BufferedReader(new InputStreamReader(jin));\r
File outFile = File.createTempFile("jalview_pdb", ".txt");\r
outFile.deleteOnExit();\r
- DataOutputStream out = new DataOutputStream(new FileOutputStream(outFile));\r
- int data;\r
- while ( (data = in.read()) != -1)\r
+ PrintWriter out = new PrintWriter(new FileOutputStream(outFile));\r
+ String data;\r
+\r
+ while ( (data = in.readLine()) != null)\r
{\r
- out.write(data);\r
+ out.println(data);\r
}\r
out.close();\r
return outFile.getAbsolutePath();\r
jalview.datamodel.PDBEntry entry = new jalview.datamodel.PDBEntry();\r
entry.setId(ids[p].getId());\r
entry.setType(ids[p].getType());\r
- if(!pdbloaded.containsKey(ids[p].getId()))\r
+ if (ids[p].getFile() != null)\r
{\r
- String tmppdb = loadPDBFile(file, ids[p].getId());\r
- entry.setFile(tmppdb);\r
- pdbloaded.put(ids[p].getId(), tmppdb);\r
+ if (!pdbloaded.containsKey(ids[p].getFile()))\r
+ {\r
+ String tmppdb = loadPDBFile(file, ids[p].getId());\r
+ entry.setFile(tmppdb);\r
+ pdbloaded.put(ids[p].getId(), tmppdb);\r
+ }\r
+ else\r
+ entry.setFile(pdbloaded.get(ids[p].getId()).toString());\r
}\r
- else\r
- entry.setFile(pdbloaded.get(ids[p].getId()).toString());\r
\r
al.getSequenceAt(i).getDatasetSequence().addPDBId(entry);\r
}\r