本文整理汇总了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);
}
示例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();
}
}
示例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;
}
示例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);
}
}
}
示例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;
}