当前位置: 首页>>代码示例>>Java>>正文


Java FileDownloadStatus.isOver方法代码示例

本文整理汇总了Java中com.liulishuo.filedownloader.model.FileDownloadStatus.isOver方法的典型用法代码示例。如果您正苦于以下问题:Java FileDownloadStatus.isOver方法的具体用法?Java FileDownloadStatus.isOver怎么用?Java FileDownloadStatus.isOver使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.liulishuo.filedownloader.model.FileDownloadStatus的用法示例。


在下文中一共展示了FileDownloadStatus.isOver方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: reset

import com.liulishuo.filedownloader.model.FileDownloadStatus; //导入方法依赖的package包/类
@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;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:25,代码来源:DownloadTaskHunter.java

示例2: handleMessage

import com.liulishuo.filedownloader.model.FileDownloadStatus; //导入方法依赖的package包/类
@Override
public boolean handleMessage(Message msg) {
    final int status = msg.what;

    switch (status) {
        case FileDownloadStatus.progress:
            handleProgress(SystemClock.elapsedRealtime(), true);
            break;
        case FileDownloadStatus.completed:
            if (interceptBeforeCompleted()) {
                return true;
            }

            try {
                handleCompleted();
            } catch (IOException e) {
                onError(e);
                return true;
            }
            break;
        case FileDownloadStatus.retry:
            handleRetry((Exception) msg.obj, msg.arg1);
            break;
        case FileDownloadStatus.paused:
            handlePaused();
            break;
        case FileDownloadStatus.error:
            handleError((Exception) msg.obj);
            break;
    }

    if (FileDownloadStatus.isOver(status)) {
        handlerThread.quit();
    }

    return true;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:38,代码来源:DownloadStatusCallback.java

示例3: inspectAndHandleOverStatus

import com.liulishuo.filedownloader.model.FileDownloadStatus; //导入方法依赖的package包/类
private void inspectAndHandleOverStatus(int status) {
    // If this task is in the over state, try to retire this messenger.
    if (FileDownloadStatus.isOver(status)) {
        if (!parcelQueue.isEmpty()) {
            final MessageSnapshot queueTopTask = parcelQueue.peek();
            throw new IllegalStateException(
                    FileDownloadUtils.formatString("the messenger[%s](with id[%d]) has already " +
                                    "accomplished all his job, but there still are some messages in" +
                                    " parcel queue[%d] queue-top-status[%d]",
                            this, queueTopTask.getId(), parcelQueue.size(), queueTopTask.getStatus()));
        }
        mTask = null;
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:15,代码来源:FileDownloadMessenger.java

示例4: inspectAndHandleOverStatus

import com.liulishuo.filedownloader.model.FileDownloadStatus; //导入方法依赖的package包/类
private void inspectAndHandleOverStatus(int status) {
    // If this task is in the over state, try to retire this messenger.
    if (FileDownloadStatus.isOver(status)) {
        if (!parcelQueue.isEmpty()) {
            final MessageSnapshot queueTopTask = parcelQueue.peek();
            FileDownloadLog.w(this,
                    "the messenger[%s](with id[%d]) has already " +
                            "accomplished all his job, but there still are some messages in" +
                            " parcel queue[%d] queue-top-status[%d]",
                    this, queueTopTask.getId(), parcelQueue.size(), queueTopTask.getStatus());
        }
        mTask = null;
    }
}
 
开发者ID:angcyo,项目名称:RLibrary,代码行数:15,代码来源:FileDownloadMessenger.java

示例5: pause

import com.liulishuo.filedownloader.model.FileDownloadStatus; //导入方法依赖的package包/类
@Override
public boolean pause() {
    if (FileDownloadStatus.isOver(getStatus())) {
        if (FileDownloadLog.NEED_LOG) {
            /**
             * The over-mStatus call-backed and set the over-mStatus to this task between here
             * area and remove from the {@link FileDownloadList}.
             *
             * High concurrent cause.
             */
            FileDownloadLog.d(this, "High concurrent cause, Already is over, can't pause " +
                    "again, %d %d", getStatus(), mTask.getRunningTask().getOrigin().getId());
        }
        return false;
    }
    this.mStatus = FileDownloadStatus.paused;

    final BaseDownloadTask.IRunningTask runningTask = mTask.getRunningTask();
    final BaseDownloadTask origin = runningTask.getOrigin();

    FileDownloadTaskLauncher.getImpl().expire(this);
    if (FileDownloadLog.NEED_LOG) {
        FileDownloadLog.v(this, "the task[%d] has been expired from the launch pool.", getId());
    }

    if (!FileDownloader.getImpl().isServiceConnected()) {
        if (FileDownloadLog.NEED_LOG) {
            FileDownloadLog.d(this, "request pause the task[%d] to the download service, but" +
                    " the download service isn't connected yet.", origin.getId());
        }
    } else {
        FileDownloadServiceProxy.getImpl().pause(origin.getId());
    }

    // For make sure already added event mListener for receive paused event
    FileDownloadList.getImpl().add(runningTask);
    FileDownloadList.getImpl().remove(runningTask, MessageSnapshotTaker.catchPause(origin));

    FileDownloader.getImpl().getLostConnectedHandler().taskWorkFine(runningTask);

    return true;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:43,代码来源:DownloadTaskHunter.java

示例6: isOver

import com.liulishuo.filedownloader.model.FileDownloadStatus; //导入方法依赖的package包/类
@Override
public boolean isOver() {
    return FileDownloadStatus.isOver(getStatus());
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:DownloadTask.java


注:本文中的com.liulishuo.filedownloader.model.FileDownloadStatus.isOver方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。