"IMPLEMENTATION ERROR: Cannot read consecutive Jalview XML projects from a stream.");
// We read the data anyway - it might make sense.
}
- alignFrame = new Jalview2XML(raiseGUI).loadJalviewAlign(file);
+ // BH 2018 switch to File object here instead of filename
+ alignFrame = new Jalview2XML(raiseGUI).loadJalviewAlign(selectedFile == null ? file : selectedFile);
}
else
{
import java.awt.Font;
import java.awt.Rectangle;
import java.io.BufferedReader;
+import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.File;
* @param file
* - HTTP URL or filename
*/
- public AlignFrame loadJalviewAlign(final String file)
+ public AlignFrame loadJalviewAlign(final Object file)
{
jalview.gui.AlignFrame af = null;
return af;
}
- private jarInputStreamProvider createjarInputStreamProvider(
- final String file) throws MalformedURLException
+ @SuppressWarnings("unused")
+private jarInputStreamProvider createjarInputStreamProvider(
+ final Object ofile) throws MalformedURLException
{
+
+ // BH 2018 allow for bytes already attached to File object
+ final String file = ofile.toString();
+ byte[] bytes = /** @j2sNative ofile._bytes ||*/null;
+ if (bytes != null) {
+
+ return new jarInputStreamProvider()
+ {
+
+ @Override
+ public JarInputStream getJarInputStream() throws IOException
+ {
+ return new JarInputStream(new ByteArrayInputStream(bytes));
+ }
+
+ @Override
+ public String getFilename()
+ {
+ return file;
+ }
+ };
+
+ }
URL url = null;
errorMessage = null;
uniqueSetSuffix = null;