本文整理汇总了Java中org.gudy.azureus2.core3.download.DownloadManager.isDownloadComplete方法的典型用法代码示例。如果您正苦于以下问题:Java DownloadManager.isDownloadComplete方法的具体用法?Java DownloadManager.isDownloadComplete怎么用?Java DownloadManager.isDownloadComplete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.gudy.azureus2.core3.download.DownloadManager
的用法示例。
在下文中一共展示了DownloadManager.isDownloadComplete方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: matchesDownload
import org.gudy.azureus2.core3.download.DownloadManager; //导入方法依赖的package包/类
public boolean matchesDownload(DownloadManager dm, ContextDescriptor context, boolean ignore_completeness ) {
if (this.getBoolean("default dir")) {
logInfo("Checking if " + describe(dm, context) + " is inside default dirs.", dm);
File[] default_dirs = getDefaultDirs();
File current_location = dm.getSaveLocation().getParentFile();
/**
* Very very rare, but I have seen this on fscked up downloads which don't appear
* to have a blank / malformed download path.
*/
if (current_location == null) {
logWarn(describe(dm, context) + " appears to have a malformed save directory, skipping.", dm);
return false;
}
if (!this.checkDefaultDir(current_location, default_dirs)) {
logWarn(describe(dm, context) +
" doesn't exist in any of the following default directories" +
" (current dir: " + current_location + ", subdirectories checked: " +
this.getBoolean("default subdir") + ") - " + Arrays.asList(default_dirs), dm);
return false;
}
logInfo(describe(dm, context) + " does exist inside default dirs.", dm);
}
// Does it work for incomplete downloads?
if (!dm.isDownloadComplete(false)) {
boolean can_move = ignore_completeness || this.getBoolean("incomplete dl");
String log_message = describe(dm, context) + " is incomplete which is " +
((can_move) ? "" : "not ") + "an appropriate state.";
if (!can_move) {
logInfo(log_message, dm);
return false;
}
}
return true;
}
示例2: prepareForProgressiveMode
import org.gudy.azureus2.core3.download.DownloadManager; //导入方法依赖的package包/类
protected void
prepareForProgressiveMode(
DownloadManager dm,
boolean active )
{
if ( active ){
GlobalManager gm = core.getGlobalManager();
List<DownloadManager> dms = (List<DownloadManager>)gm.getDownloadManagers();
for ( DownloadManager this_dm: dms ){
if ( this_dm == dm ){
continue;
}
if ( !this_dm.isDownloadComplete(false)){
int state = this_dm.getState();
if ( state == DownloadManager.STATE_DOWNLOADING ||
state == DownloadManager.STATE_QUEUED) {
pause( this_dm );
}
}
}
if ( dm.isPaused()){
dm.resume();
}
}else{
resume();
}
}
示例3: canGoToCompleteDir
import org.gudy.azureus2.core3.download.DownloadManager; //导入方法依赖的package包/类
public static boolean canGoToCompleteDir(DownloadManager dm) {
return (dm.isDownloadComplete(false) && isOnCompleteEnabled());
}