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


Java FileDownloadLog.e方法代码示例

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


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

示例1: onRetry

import com.liulishuo.filedownloader.util.FileDownloadLog; //导入方法依赖的package包/类
@Override
public void onRetry(Exception exception, long invalidIncreaseBytes) {
    if (paused) {
        if (FileDownloadLog.NEED_LOG) {
            FileDownloadLog.d(this, "the task[%d] has already been paused, so pass the" +
                    " retry callback", model.getId());
        }
        return;
    }

    if (validRetryTimes-- < 0) {
        FileDownloadLog.e(this, "valid retry times is less than 0(%d) for download task(%d)",
                validRetryTimes, model.getId());
    }

    statusCallback.onRetry(exception, validRetryTimes--, invalidIncreaseBytes);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:18,代码来源:DownloadLaunchRunnable.java

示例2: onCompleted

import com.liulishuo.filedownloader.util.FileDownloadLog; //导入方法依赖的package包/类
@Override
public void onCompleted(DownloadRunnable doneRunnable, long startOffset, long endOffset)
        throws IOException {
    if (paused) {
        if (FileDownloadLog.NEED_LOG) {
            FileDownloadLog.d(this, "the task[%d] has already been paused, so pass the" +
                    " completed callback", model.getId());
        }
        return;
    }

    boolean allConnectionCompleted = false;

    final int doneConnectionIndex = doneRunnable == null ? -1 : doneRunnable.connectionIndex;
    if (FileDownloadLog.NEED_LOG) {
        FileDownloadLog.d(this, "the connection has been completed(%d): [%d, %d)  %d",
                doneConnectionIndex, startOffset, endOffset, model.getTotal());
    }

    if (isSingleConnection) {
        if (startOffset != 0 && endOffset != model.getTotal()) {
            FileDownloadLog.e(this, "the single task not completed corrected(%d, %d != %d) " +
                    "for task(%d)", startOffset, endOffset, model.getTotal(), model.getId());
        }

        allConnectionCompleted = true;
    } else {
        synchronized (downloadRunnableList) {
            downloadRunnableList.remove(doneRunnable);
        }

        if (downloadRunnableList.size() <= 0) {
            allConnectionCompleted = true;
        }
    }

    if (allConnectionCompleted) {
        statusCallback.onCompleted();
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:41,代码来源:DownloadLaunchRunnable.java

示例3: callback

import com.liulishuo.filedownloader.util.FileDownloadLog; //导入方法依赖的package包/类
@SuppressWarnings("UnusedReturnValue")
private synchronized int callback(MessageSnapshot snapShot) {
    final int n = callbackList.beginBroadcast();
    try {
        for (int i = 0; i < n; i++) {
            callbackList.getBroadcastItem(i).callback(snapShot);
        }
    } catch (RemoteException e) {
        FileDownloadLog.e(this, e, "callback error");
    } finally {
        callbackList.finishBroadcast();
    }

    return n;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:16,代码来源:FDServiceSeparateHandler.java

示例4: onCompleted

import com.liulishuo.filedownloader.util.FileDownloadLog; //导入方法依赖的package包/类
@Override
public void onCompleted(DownloadRunnable doneRunnable, long startOffset, long endOffset) {
    if (paused) {
        if (FileDownloadLog.NEED_LOG) {
            FileDownloadLog.d(this, "the task[%d] has already been paused, so pass the" +
                    " completed callback", model.getId());
        }
        return;
    }

    final int doneConnectionIndex = doneRunnable == null ? -1 : doneRunnable.connectionIndex;
    if (FileDownloadLog.NEED_LOG) {
        FileDownloadLog.d(this, "the connection has been completed(%d): [%d, %d)  %d",
                doneConnectionIndex, startOffset, endOffset, model.getTotal());
    }

    if (isSingleConnection) {
        if (startOffset != 0 && endOffset != model.getTotal()) {
            FileDownloadLog.e(this, "the single task not completed corrected(%d, %d != %d) " +
                    "for task(%d)", startOffset, endOffset, model.getTotal(), model.getId());
        }
    } else {
        synchronized (downloadRunnableList) {
            downloadRunnableList.remove(doneRunnable);
        }
    }
}
 
开发者ID:angcyo,项目名称:RLibrary,代码行数:28,代码来源:DownloadLaunchRunnable.java

示例5: remove

import com.liulishuo.filedownloader.util.FileDownloadLog; //导入方法依赖的package包/类
/**
 * @param willRemoveDownload will be remove
 */
public boolean remove(final BaseDownloadTask.IRunningTask willRemoveDownload,
                      MessageSnapshot snapshot) {
    final byte removeByStatus = snapshot.getStatus();
    boolean succeed;
    synchronized (mList) {
        succeed = mList.remove(willRemoveDownload);
    }
    if (FileDownloadLog.NEED_LOG) {
        if (mList.size() == 0) {
            FileDownloadLog.v(this, "remove %s left %d %d",
                    willRemoveDownload, removeByStatus, mList.size());
        }
    }

    if (succeed) {
        final IFileDownloadMessenger messenger = willRemoveDownload.getMessageHandler().
                getMessenger();
        // Notify 2 Listener
        switch (removeByStatus) {
            case FileDownloadStatus.warn:
                messenger.notifyWarn(snapshot);
                break;
            case FileDownloadStatus.error:
                messenger.notifyError(snapshot);
                break;
            case FileDownloadStatus.paused:
                messenger.notifyPaused(snapshot);
                break;
            case FileDownloadStatus.completed:
                messenger.notifyBlockComplete(MessageSnapshotTaker.takeBlockCompleted(snapshot));
                break;
        }

    } else {
        FileDownloadLog.e(this, "remove error, not exist: %s %d", willRemoveDownload,
                removeByStatus);
    }

    return succeed;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:44,代码来源:FileDownloadList.java


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