if (isParseWithJMOL)
{
// needs a File option
- alignFile = new JmolParser(inFile, sourceType);
+ alignFile = new JmolParser(selectedFile == null ? inFile : selectedFile, sourceType);
}
else
{
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 data
+ * @param dataObject File or String
* @return the protocol for the input data
*/
- public static DataSourceType checkProtocol(String data)
+ public static DataSourceType checkProtocol(Object dataObject)
{
+ if(dataObject instanceof File)
+ return DataSourceType.FILE;
+
+ String data = dataObject.toString();
DataSourceType protocol = DataSourceType.PASTE;
String ft = data.toLowerCase().trim();
if (ft.indexOf("http:") == 0 || ft.indexOf("https:") == 0