}
java.net.URI uri = new java.net.URI(s);
- java.io.File file = new java.io.File(uri);
- files.add(file);
+ // check to see if we can handle this kind of URI
+ if (uri.getScheme().toLowerCase().startsWith("http"))
+ {
+ files.add(uri.toString());
+ }
+ else
+ {
+ // otherwise preserve old behaviour: catch all for file objects
+ java.io.File file = new java.io.File(uri);
+ files.add(file.toString());
+ }
}
}
} catch (Exception e)
}
/**
- * Attempt to load a "dropped" file: First by testing whether it's and
+ * Attempt to load a "dropped" file or URL string: First by testing whether it's and
* Annotation file, then a JNet file, and finally a features file. If all are
* false then the user may have dropped an alignment file onto this
* AlignFrame.
{
try
{
- String protocol = "File";
-
- if (file.indexOf("http:") > -1 || file.indexOf("file:") > -1)
+ String protocol = jalview.io.FormatAdapter.FILE;
+ String f=file.toLowerCase();
+ if (f.indexOf("http:") == 0 || f.indexOf("https:")==0 || f.indexOf("file:") == 0)
{
- protocol = "URL";
+ protocol = jalview.io.FormatAdapter.URL;
}
boolean isAnnotation = new AnnotationFile().readAnnotationFile(