X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FFileLoader.java;h=4016e71e765f8b51d7a0423dc73c1a57ec553b2b;hb=d1cf4609268fb7fbae0716b6e699a130eea02647;hp=c7c1d716bbe822bb2eea453df751f20c34dc9741;hpb=232fd33251ad898065d090e99efa717b56cbc5e8;p=jalview.git diff --git a/src/jalview/io/FileLoader.java b/src/jalview/io/FileLoader.java index c7c1d71..4016e71 100755 --- a/src/jalview/io/FileLoader.java +++ b/src/jalview/io/FileLoader.java @@ -96,7 +96,8 @@ public class FileLoader implements Runnable DataSourceType protocol, FileFormatI format) { this.viewport = viewport; - if (file instanceof File) { + if (file instanceof File) + { this.selectedFile = (File) file; file = selectedFile.getPath(); } @@ -285,7 +286,8 @@ public class FileLoader implements Runnable format = new IdentifyFile().identify(source, false); // identify stream and rewind rather than close } - else if (selectedFile != null) { + else if (selectedFile != null) + { format = new IdentifyFile().identify(selectedFile, protocol); } else @@ -334,7 +336,8 @@ public class FileLoader implements Runnable // We read the data anyway - it might make sense. } // BH 2018 switch to File object here instead of filename - alignFrame = new Jalview2XML(raiseGUI).loadJalviewAlign(selectedFile == null ? file : selectedFile); + alignFrame = new Jalview2XML(raiseGUI).loadJalviewAlign( + selectedFile == null ? file : selectedFile); } else { @@ -362,27 +365,29 @@ public class FileLoader implements Runnable file.lastIndexOf(".")); String tempStructureFileStr = createNamedJvTempFile( urlLeafName, structExt); - + // BH - switching to File object here so as to hold // ._bytes array directly File tempFile = new File(tempStructureFileStr); UrlDownloadClient.download(file, tempFile); - - al = fa.readFile(tempFile, DataSourceType.FILE, - format); + + al = fa.readFile(tempFile, DataSourceType.FILE, format); source = fa.getAlignFile(); } else { - if (selectedFile == null) { + if (selectedFile == null) + { al = fa.readFile(file, protocol, format); - - } else { + + } + else + { al = fa.readFile(selectedFile, protocol, format); - } + } source = fa.getAlignFile(); // keep reference for later if - - // necessary. + + // necessary. } } } catch (java.io.IOException ex) @@ -483,8 +488,8 @@ public class FileLoader implements Runnable try { - alignFrame.setMaximum(jalview.bin.Cache - .getDefault("SHOW_FULLSCREEN", false)); + alignFrame.setMaximum( + Cache.getDefault("SHOW_FULLSCREEN", false)); } catch (java.beans.PropertyVetoException ex) { }