X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FAppletFormatAdapter.java;h=5de14a43272af4839a79231ca98976b92b67128d;hb=fbfbbe26bee37143d5279fe4d254a5a89c96b021;hp=c25d3d9cdd0b58236a5b6aa8b9faa407e4d98513;hpb=8286731258d314669ee6facb627947fe159ac1eb;p=jalview.git diff --git a/src/jalview/io/AppletFormatAdapter.java b/src/jalview/io/AppletFormatAdapter.java index c25d3d9..5de14a4 100755 --- a/src/jalview/io/AppletFormatAdapter.java +++ b/src/jalview/io/AppletFormatAdapter.java @@ -155,9 +155,10 @@ public class AppletFormatAdapter { return readFile(null, file, sourceType, fileFormat); } - - public AlignmentI readFile(File selectedFile, String file, DataSourceType sourceType, - FileFormatI fileFormat) throws IOException + + public AlignmentI readFile(File selectedFile, String file, + DataSourceType sourceType, FileFormatI fileFormat) + throws IOException { this.selectedFile = selectedFile; @@ -180,7 +181,8 @@ public class AppletFormatAdapter if (isParseWithJMOL) { // needs a File option - alignFile = new JmolParser(selectedFile == null ? inFile : selectedFile, sourceType); + alignFile = new JmolParser( + selectedFile == null ? inFile : selectedFile, sourceType); } else { @@ -193,9 +195,12 @@ public class AppletFormatAdapter ((StructureFile) alignFile).setDbRefType( FileFormat.PDB.equals(fileFormat) ? Type.PDB : Type.MMCIF); } - else if (selectedFile != null) { - alignFile = fileFormat.getReader(new FileParse(selectedFile, sourceType)); - } else + else if (selectedFile != null) + { + alignFile = fileFormat + .getReader(new FileParse(selectedFile, sourceType)); + } + else { // alignFile = fileFormat.getAlignmentFile(inFile, sourceType); alignFile = fileFormat.getReader(new FileParse(inFile, sourceType)); @@ -427,23 +432,23 @@ public class AppletFormatAdapter return null; } - /** * Determines the protocol (i.e DataSourceType.{FILE|PASTE|URL}) for the input * data * * BH 2018 allows File or String, and can return RELATIVE_URL * - * @param dataObject File or String + * @param dataObject + * File or String * @return the protocol for the input data */ public static DataSourceType checkProtocol(Object dataObject) { - if(dataObject instanceof File) + if (dataObject instanceof File) { return DataSourceType.FILE; } - + String data = dataObject.toString(); DataSourceType protocol = DataSourceType.PASTE; String ft = data.toLowerCase(Locale.ROOT).trim();