use of com.biglybt.core.download.DiskManagerFileInfoFile in project BiglyBT by BiglySoftware.
the class TranscodeFileImpl method getSourceFile.
@Override
public DiskManagerFileInfo getSourceFile() throws TranscodeException {
checkDeleted();
// options are either a download file or a link to an existing non-torrent based file
String hash = getString(KEY_SOURCE_FILE_HASH);
if (hash != null) {
try {
Download download = PluginInitializer.getDefaultInterface().getDownloadManager().getDownload(Base32.decode(hash));
if (download != null) {
int index = (int) getLong(KEY_SOURCE_FILE_INDEX);
return (download.getDiskManagerFileInfo(index));
}
} catch (Throwable e) {
}
}
String link = getString(KEY_SOURCE_FILE_LINK);
if (link != null) {
File link_file = new File(link);
if (link_file.exists() || getBoolean(KEY_NO_XCODE)) {
return (new DiskManagerFileInfoFile(link_file));
}
}
return (new DiskManagerFileInfoFile(getCacheFile()));
}
Aggregations