本文整理汇总了Java中com.liulishuo.filedownloader.model.FileDownloadStatus.INVALID_STATUS属性的典型用法代码示例。如果您正苦于以下问题:Java FileDownloadStatus.INVALID_STATUS属性的具体用法?Java FileDownloadStatus.INVALID_STATUS怎么用?Java FileDownloadStatus.INVALID_STATUS使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.liulishuo.filedownloader.model.FileDownloadStatus
的用法示例。
在下文中一共展示了FileDownloadStatus.INVALID_STATUS属性的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: reset
@Override
public void reset() {
mThrowable = null;
mEtag = null;
mIsResuming = false;
mRetryingTimes = 0;
mIsReusedOldFile = false;
mIsLargeFile = false;
mSoFarBytes = 0;
mTotalBytes = 0;
mSpeedMonitor.reset();
if (FileDownloadStatus.isOver(mStatus)) {
mMessenger.discard();
mMessenger = new FileDownloadMessenger(mTask.getRunningTask(), this);
} else {
mMessenger.reAppointment(mTask.getRunningTask(), this);
}
mStatus = FileDownloadStatus.INVALID_STATUS;
}
示例2: getStatus
/**
* @param id The downloadId.
* @param path The target file path.
* @return the downloading status.
* @see FileDownloadStatus
* @see #getStatus(String, String)
* @see #getStatusIgnoreCompleted(int)
*/
public byte getStatus(final int id, final String path) {
byte status;
BaseDownloadTask.IRunningTask task = FileDownloadList.getImpl().get(id);
if (task == null) {
status = FileDownloadServiceProxy.getImpl().getStatus(id);
} else {
status = task.getOrigin().getStatus();
}
if (path != null && status == FileDownloadStatus.INVALID_STATUS) {
if (FileDownloadUtils.isFilenameConverted(FileDownloadHelper.getAppContext()) &&
new File(path).exists()) {
status = FileDownloadStatus.completed;
}
}
return status;
}
示例3: getStatus
@Override
public byte getStatus(final int id) {
if (!isConnected()) {
return DownloadServiceNotConnectedHelper.getStatus(id);
}
byte status = FileDownloadStatus.INVALID_STATUS;
try {
status = getService().getStatus(id);
} catch (RemoteException e) {
e.printStackTrace();
}
return status;
}
示例4: getStatus
public byte getStatus(final int id) {
final FileDownloadModel model = mDatabase.find(id);
if (model == null) {
return FileDownloadStatus.INVALID_STATUS;
}
return model.getStatus();
}
示例5: free
@Override
public void free() {
if (FileDownloadLog.NEED_LOG) {
FileDownloadLog.d(this, "free the task %d, when the status is %d", getId(), mStatus);
}
mStatus = FileDownloadStatus.INVALID_STATUS;
}
示例6: getStatus
public static byte getStatus(final int id) {
log("request get the status for the task[%d] in the download service", id);
return FileDownloadStatus.INVALID_STATUS;
}
示例7: intoLaunchPool
@Override
public void intoLaunchPool() {
synchronized (mPauseLock) {
if (mStatus != FileDownloadStatus.INVALID_STATUS) {
FileDownloadLog.w(this, "High concurrent cause, this task %d will not input " +
"to launch pool, because of the status isn't idle : %d",
getId(), mStatus);
return;
}
mStatus = FileDownloadStatus.toLaunchPool;
}
final BaseDownloadTask.IRunningTask runningTask = mTask.getRunningTask();
final BaseDownloadTask origin = runningTask.getOrigin();
if (FileDownloadMonitor.isValid()) {
FileDownloadMonitor.getMonitor().onRequestStart(origin);
}
if (FileDownloadLog.NEED_LOG) {
FileDownloadLog.v(this, "call start " +
"Url[%s], Path[%s] Listener[%s], Tag[%s]",
origin.getUrl(), origin.getPath(), origin.getListener(), origin.getTag());
}
boolean ready = true;
try {
prepare();
} catch (Throwable e) {
ready = false;
FileDownloadList.getImpl().add(runningTask);
FileDownloadList.getImpl().remove(runningTask, prepareErrorMessage(e));
}
if (ready) {
FileDownloadTaskLauncher.getImpl().launch(this);
}
if (FileDownloadLog.NEED_LOG) {
FileDownloadLog.v(this, "the task[%d] has been into the launch pool.", getId());
}
}
示例8: isUsing
@Override
public boolean isUsing() {
return mHunter.getStatus() != FileDownloadStatus.INVALID_STATUS;
}
示例9: handleMessage
@Override
public boolean handleMessage(final Message msg) {
if (msg.what == WHAT_SERIAL_NEXT) {
if (msg.arg1 >= mList.size()) {
synchronized (mRunningSerialMap) {
mRunningSerialMap.remove(mList.get(0).getAttachKey());
}
// final serial tasks
if (this.mHandler != null && this.mHandler.getLooper() != null) {
this.mHandler.getLooper().quit();
this.mHandler = null;
this.mList = null;
this.mSerialFinishListener = null;
}
if (FileDownloadLog.NEED_LOG) {
FileDownloadLog.d(SerialHandlerCallback.class, "final serial %s %d",
this.mList == null ? null : this.mList.get(0) == null ?
null : this.mList.get(0).getOrigin().getListener(),
msg.arg1);
}
return true;
}
mRunningIndex = msg.arg1;
final BaseDownloadTask.IRunningTask stackTopTask = this.mList.get(mRunningIndex);
synchronized (stackTopTask.getPauseLock()) {
if (stackTopTask.getOrigin().getStatus() != FileDownloadStatus.INVALID_STATUS ||
FileDownloadList.getImpl().isNotContains(stackTopTask)) {
// pause?
if (FileDownloadLog.NEED_LOG) {
FileDownloadLog.d(SerialHandlerCallback.class,
"direct go next by not contains %s %d", stackTopTask, msg.arg1);
}
goNext(msg.arg1 + 1);
return true;
}
stackTopTask.getOrigin()
.addFinishListener(mSerialFinishListener.setNextIndex(mRunningIndex + 1));
stackTopTask.startTaskByQueue();
}
} else if (msg.what == WHAT_FREEZE) {
freeze();
} else if (msg.what == WHAT_UNFREEZE) {
unfreeze();
}
return true;
}