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


Java FileDownloadStatus.INVALID_STATUS属性代码示例

本文整理汇总了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;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:24,代码来源:DownloadTaskHunter.java

示例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;
}
 
开发者ID:yannanzheng,项目名称:FileDownloader-master,代码行数:26,代码来源:FileDownloader.java

示例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;
}
 
开发者ID:angcyo,项目名称:RLibrary,代码行数:15,代码来源:FileDownloadServiceUIGuard.java

示例4: getStatus

public byte getStatus(final int id) {
    final FileDownloadModel model = mDatabase.find(id);
    if (model == null) {
        return FileDownloadStatus.INVALID_STATUS;
    }

    return model.getStatus();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:8,代码来源:FileDownloadManager.java

示例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;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:7,代码来源:DownloadTaskHunter.java

示例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;
}
 
开发者ID:angcyo,项目名称:RLibrary,代码行数:4,代码来源:DownloadServiceNotConnectedHelper.java

示例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());
    }
}
 
开发者ID:angcyo,项目名称:RLibrary,代码行数:45,代码来源:DownloadTaskHunter.java

示例8: isUsing

@Override
public boolean isUsing() {
    return mHunter.getStatus() != FileDownloadStatus.INVALID_STATUS;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:4,代码来源:DownloadTask.java

示例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;
}
 
开发者ID:yannanzheng,项目名称:FileDownloader-master,代码行数:50,代码来源:QueuesHandler.java


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