+ boolean downloadStructureFile = format.isStructureFile()
+ && protocol.equals(DataSourceType.URL);
+ if (downloadStructureFile)
+ {
+ String structExt = format.getExtensions().split(",")[0];
+ String urlLeafName = file.substring(
+ file.lastIndexOf(
+ System.getProperty("file.separator")),
+ 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);
+ source = fa.getAlignFile();
+ }
+ else
+ {
+ if (selectedFile == null)
+ {
+ al = fa.readFile(null, file, protocol, format);
+
+ }
+ else
+ {
+ al = fa.readFile(selectedFile, null, protocol, format);
+ }
+ source = fa.getAlignFile(); // keep reference for later if
+
+ // necessary.
+ }