Search in sources :

Example 1 with DiskManagerFileInfoFile

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()));
}
Also used : DiskManagerFileInfoFile(com.biglybt.core.download.DiskManagerFileInfoFile) Download(com.biglybt.pif.download.Download) File(java.io.File) DiskManagerFileInfoFile(com.biglybt.core.download.DiskManagerFileInfoFile)

Aggregations

DiskManagerFileInfoFile (com.biglybt.core.download.DiskManagerFileInfoFile)1 Download (com.biglybt.pif.download.Download)1 File (java.io.File)1