: FormatAdapter.checkProtocol(fileName));
if (protocol == DataSourceType.FILE)
{
- File fl = (file instanceof File ? (File) file
- : new File(fileName));
+ File fl;
+ if (file instanceof File) {
+ fl = (File) file;
+ Platform.cacheFileData(fl);
+ } else {
+ fl = new File(fileName);
+ }
pdbfn = fl.getName();
}
else if (protocol == DataSourceType.URL)
}
for (File f : files)
{
- String path = f.getAbsolutePath();
- byte[] data = Platform.getFileBytes(f);
- if (data != null)
- {
- Platform.cacheFileData(path, data);
- }
+ Platform.cacheFileData(f);
}
}
}
{
format = new IdentifyFile().identify(file, protocol);
}
-
+ if (file instanceof File)
+ {
+ Platform.cacheFileData((File) file);
+ }
new FileLoader().LoadFile(null, file, protocol, format);
}
*/
}
+ public static void cacheFileData(File file)
+ {
+ byte[] data;
+ if (!isJS() || (data = Platform.getFileBytes(file)) == null)
+ {
+ return;
+ }
+ cacheFileData(file.toString(), data);
+ }
+
public static byte[] getFileBytes(File f)
{
return /** @j2sNative f && f._bytes || */