本文整理匯總了Java中com.aelitis.azureus.core.download.DownloadManagerEnhancer類的典型用法代碼示例。如果您正苦於以下問題:Java DownloadManagerEnhancer類的具體用法?Java DownloadManagerEnhancer怎麽用?Java DownloadManagerEnhancer使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
DownloadManagerEnhancer類屬於com.aelitis.azureus.core.download包,在下文中一共展示了DownloadManagerEnhancer類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: canProgressiveOrIsComplete
import com.aelitis.azureus.core.download.DownloadManagerEnhancer; //導入依賴的package包/類
public static boolean canProgressiveOrIsComplete(TOTorrent torrent) {
if (torrent == null) {
return false;
}
try {
DownloadManagerEnhancer enhancer = DownloadManagerEnhancer.getSingleton();
EnhancedDownloadManager edm = DownloadManagerEnhancer.getSingleton().getEnhancedDownload(
torrent.getHash());
if (edm == null) {
return enhancer.isProgressiveAvailable()
&& PlatformTorrentUtils.isContentProgressive(torrent);
}
boolean complete = edm.getDownloadManager().isDownloadComplete(false);
if (complete) {
return true;
}
// not complete
if (!edm.supportsProgressiveMode()) {
return false;
}
} catch (TOTorrentException e) {
return false;
}
return true;
}
示例2: getPrimaryFileIndex
import com.aelitis.azureus.core.download.DownloadManagerEnhancer; //導入依賴的package包/類
/**
* @deprecated but still used by EMP
*/
public static int getPrimaryFileIndex(Download dl) {
EnhancedDownloadManager edm = DownloadManagerEnhancer.getSingleton().getEnhancedDownload( PluginCoreUtils.unwrap(dl) );
if ( edm == null ) {
return -1;
}
return edm.getPrimaryFileIndex();
}
示例3: getEDM
import com.aelitis.azureus.core.download.DownloadManagerEnhancer; //導入依賴的package包/類
public EnhancedDownloadManager getEDM(DownloadManager dm) {
DownloadManagerEnhancer dmEnhancer = DownloadManagerEnhancer.getSingleton();
if (dmEnhancer == null) {
return null;
}
return dmEnhancer.getEnhancedDownload(dm);
}
示例4: prepareForPlay
import com.aelitis.azureus.core.download.DownloadManagerEnhancer; //導入依賴的package包/類
public static boolean prepareForPlay(DownloadManager dm) {
EnhancedDownloadManager edm = DownloadManagerEnhancer.getSingleton().getEnhancedDownload(
dm);
if (edm != null) {
edm.setProgressiveMode(true);
return (true);
}
return (false);
}