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


Java DownloadFileInfo类代码示例

本文整理汇总了Java中org.wlf.filedownloader.DownloadFileInfo的典型用法代码示例。如果您正苦于以下问题:Java DownloadFileInfo类的具体用法?Java DownloadFileInfo怎么用?Java DownloadFileInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: beginDownloads

import org.wlf.filedownloader.DownloadFileInfo; //导入依赖的package包/类
private void beginDownloads(int currentDownloadIndex, List<String> urls) {
    try {
        FileDownloader.delete(urls.get(currentDownloadIndex), true, new OnDeleteDownloadFileListener() {
            @Override
            public void onDeleteDownloadFilePrepared(DownloadFileInfo downloadFileNeedDelete) {
            }

            @Override
            public void onDeleteDownloadFileSuccess(DownloadFileInfo downloadFileDeleted) {
                FileDownloader.start(urls.get(currentDownloadIndex));
            }

            @Override
            public void onDeleteDownloadFileFailed(DownloadFileInfo downloadFileInfo, DeleteDownloadFileFailReason failReason) {
                if (DeleteDownloadFileFailReason.TYPE_FILE_RECORD_IS_NOT_EXIST.equals(failReason.getType())) {
                    FileDownloader.start(urls.get(currentDownloadIndex));
                }
            }
        });
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
开发者ID:junchenChow,项目名称:exciting-app,代码行数:24,代码来源:VoicePresenter.java

示例2: addNewDownloadFileInfo

import org.wlf.filedownloader.DownloadFileInfo; //导入依赖的package包/类
/**
 * add new download file info
 */
public boolean addNewDownloadFileInfo(DownloadFileInfo downloadFileInfo) {
    if (downloadFileInfo != null) {
        if (!mDownloadFileInfos.contains(downloadFileInfo)) {
            boolean isFind = false;
            for (DownloadFileInfo info : mDownloadFileInfos) {
                if (info != null && info.getUrl().equals(downloadFileInfo.getUrl())) {
                    isFind = true;
                    break;
                }
            }
            if (isFind) {
                return false;
            }
            mDownloadFileInfos.add(downloadFileInfo);
            notifyDataSetChanged();
            return true;
        }
    }
    return false;
}
 
开发者ID:wlfcolin,项目名称:file-downloader,代码行数:24,代码来源:DownloadFileListAdapter.java

示例3: notifySuccess

import org.wlf.filedownloader.DownloadFileInfo; //导入依赖的package包/类
/**
 * notifySuccess
 */
private void notifySuccess(DownloadFileInfo downloadFileInfo) {
    if (mIsNotifyFinish.get()) {
        return;
    }

    if (mIsNotifyFinish.compareAndSet(false, true)) {
        if (mOnDeleteDownloadFileListener != null) {
            if (mIsSyncCallback) {
                mOnDeleteDownloadFileListener.onDeleteDownloadFileSuccess(downloadFileInfo);
            } else {
                OnDeleteDownloadFileListener.MainThreadHelper.onDeleteDownloadFileSuccess(downloadFileInfo,
                        mOnDeleteDownloadFileListener);
            }
        }
    }
}
 
开发者ID:wlfcolin,项目名称:file-downloader,代码行数:20,代码来源:DeleteDownloadFileTask.java

示例4: onFileDownloadStatusPreparing

import org.wlf.filedownloader.DownloadFileInfo; //导入依赖的package包/类
@Override
public void onFileDownloadStatusPreparing(DownloadFileInfo downloadFileInfo) {

    if (downloadFileInfo == null) {
        return;
    }

    String url = downloadFileInfo.getUrl();
    View cacheConvertView = mConvertViews.get(url);
    if (cacheConvertView != null) {
        TextView tvText = (TextView) cacheConvertView.findViewById(R.id.tvText);
        tvText.setText(cacheConvertView.getContext().getString(R.string.main__getting_resource));

        Log.d(TAG, "onFileDownloadStatusPreparing url:" + url + ",status(正常应该是" + Status
                .DOWNLOAD_STATUS_PREPARING + "):" + downloadFileInfo.getStatus());
    } else {
        updateShow();
    }
}
 
开发者ID:wlfcolin,项目名称:file-downloader,代码行数:20,代码来源:DownloadFileListAdapter.java

示例5: onFileDownloadStatusPrepared

import org.wlf.filedownloader.DownloadFileInfo; //导入依赖的package包/类
@Override
public void onFileDownloadStatusPrepared(DownloadFileInfo downloadFileInfo) {

    if (downloadFileInfo == null) {
        return;
    }

    String url = downloadFileInfo.getUrl();
    View cacheConvertView = mConvertViews.get(url);
    if (cacheConvertView != null) {
        TextView tvText = (TextView) cacheConvertView.findViewById(R.id.tvText);
        tvText.setText(cacheConvertView.getContext().getString(R.string.main__connected_resource));

        Log.d(TAG, "onFileDownloadStatusPrepared url:" + url + ",status(正常应该是" + Status.DOWNLOAD_STATUS_PREPARED 
                + "):" + downloadFileInfo.getStatus());
    } else {
        updateShow();
    }
}
 
开发者ID:wlfcolin,项目名称:file-downloader,代码行数:20,代码来源:DownloadFileListAdapter.java

示例6: onFileDownloadStatusPaused

import org.wlf.filedownloader.DownloadFileInfo; //导入依赖的package包/类
@Override
public void onFileDownloadStatusPaused(DownloadFileInfo downloadFileInfo) {

    if (downloadFileInfo == null) {
        return;
    }

    String url = downloadFileInfo.getUrl();

    Log.d(TAG, "onFileDownloadStatusPaused url:" + url + ",status(正常应该是" + Status.DOWNLOAD_STATUS_PAUSED + "):" +
            downloadFileInfo.getStatus());

    View cacheConvertView = mConvertViews.get(url);
    if (cacheConvertView != null) {

        LinearLayout lnlyDownloadItem = (LinearLayout) cacheConvertView.findViewById(R.id.lnlyDownloadItem);
        TextView tvText = (TextView) cacheConvertView.findViewById(R.id.tvText);

        tvText.setText(cacheConvertView.getContext().getString(R.string.main__paused));

        setBackgroundOnClickListener(lnlyDownloadItem, downloadFileInfo);
    } else {
        updateShow();
    }

}
 
开发者ID:wlfcolin,项目名称:file-downloader,代码行数:27,代码来源:DownloadFileListAdapter.java

示例7: onDeleteDownloadFileFailed

import org.wlf.filedownloader.DownloadFileInfo; //导入依赖的package包/类
/**
 * delete failed
 *
 * @param downloadFileInfo download file needed to delete,may be null
 * @param failReason       fail reason
 */
public static void onDeleteDownloadFileFailed(final DownloadFileInfo downloadFileInfo, final 
DeleteDownloadFileFailReason failReason, final OnDeleteDownloadFileListener onDeleteDownloadFileListener) {
    if (onDeleteDownloadFileListener == null) {
        return;
    }
    Handler handler = new Handler(Looper.getMainLooper());
    handler.post(new Runnable() {
        @Override
        public void run() {
            if (onDeleteDownloadFileListener == null) {
                return;
            }
            onDeleteDownloadFileListener.onDeleteDownloadFileFailed(downloadFileInfo, failReason);
        }
    });
}
 
开发者ID:wlfcolin,项目名称:file-downloader,代码行数:23,代码来源:OnDeleteDownloadFileListener.java

示例8: onFileDownloadStatusPrepared

import org.wlf.filedownloader.DownloadFileInfo; //导入依赖的package包/类
@Override
public void onFileDownloadStatusPrepared(DownloadFileInfo downloadFileInfo) {
    // if cur task stopped,stop internal impl, wait notifyTaskFinish()
    if (mIsTaskStop) {
        // stop internal impl
        stopInternalImpl();
        // wait for the task run method finished, notifyTaskFinish()
        return;
    }
    if (mOnFileDownloadStatusListener != null) {
        mOnFileDownloadStatusListener.onFileDownloadStatusPrepared(downloadFileInfo);
    }

    if (DownloadFileUtil.isLegal(downloadFileInfo)) {
        // record download range
        mRecordedRange = new Range(downloadFileInfo.getDownloadedSizeLong(), mRecordedRange.endPos);
    }
}
 
开发者ID:wlfcolin,项目名称:file-downloader,代码行数:19,代码来源:RetryableDownloadTaskImpl.java

示例9: findPosition

import org.wlf.filedownloader.DownloadFileInfo; //导入依赖的package包/类
private int findPosition(DownloadFileInfo downloadFileInfo) {
    if (downloadFileInfo == null) {
        return -1;
    }
    for (int i = 0; i < mCoursePreviewInfos.size(); i++) {
        CoursePreviewInfo coursePreviewInfo = mCoursePreviewInfos.get(i);
        if (coursePreviewInfo == null || TextUtils.isEmpty(coursePreviewInfo.getCourseUrl())) {
            continue;
        }
        if (coursePreviewInfo.getCourseUrl().equals(downloadFileInfo.getUrl())) {
            // find
            return i;
        }
    }
    return -1;
}
 
开发者ID:wlfcolin,项目名称:file-downloader,代码行数:17,代码来源:CourseDownloadAdapter.java

示例10: onMoveDownloadFilePrepared

import org.wlf.filedownloader.DownloadFileInfo; //导入依赖的package包/类
/**
 * prepared move
 *
 * @param downloadFileNeedToMove download file needed to move
 */
public static void onMoveDownloadFilePrepared(final DownloadFileInfo downloadFileNeedToMove, final 
OnMoveDownloadFileListener onMoveDownloadFileListener) {
    if (onMoveDownloadFileListener == null) {
        return;
    }
    Handler handler = new Handler(Looper.getMainLooper());
    handler.post(new Runnable() {
        @Override
        public void run() {
            if (onMoveDownloadFileListener == null) {
                return;
            }
            onMoveDownloadFileListener.onMoveDownloadFilePrepared(downloadFileNeedToMove);
        }
    });
}
 
开发者ID:wlfcolin,项目名称:file-downloader,代码行数:22,代码来源:OnMoveDownloadFileListener.java

示例11: onMoveDownloadFileSuccess

import org.wlf.filedownloader.DownloadFileInfo; //导入依赖的package包/类
/**
 * move succeed
 *
 * @param downloadFileMoved download file moved
 */
public static void onMoveDownloadFileSuccess(final DownloadFileInfo downloadFileMoved, final 
OnMoveDownloadFileListener onMoveDownloadFileListener) {
    if (onMoveDownloadFileListener == null) {
        return;
    }
    Handler handler = new Handler(Looper.getMainLooper());
    handler.post(new Runnable() {
        @Override
        public void run() {
            if (onMoveDownloadFileListener == null) {
                return;
            }
            onMoveDownloadFileListener.onMoveDownloadFileSuccess(downloadFileMoved);
        }
    });
}
 
开发者ID:wlfcolin,项目名称:file-downloader,代码行数:22,代码来源:OnMoveDownloadFileListener.java

示例12: onMoveDownloadFileFailed

import org.wlf.filedownloader.DownloadFileInfo; //导入依赖的package包/类
/**
 * move failed
 *
 * @param downloadFileInfo download file needed to move,may be null
 * @param failReason       fail reason
 */
public static void onMoveDownloadFileFailed(final DownloadFileInfo downloadFileInfo, final 
MoveDownloadFileFailReason failReason, final OnMoveDownloadFileListener onMoveDownloadFileListener) {
    if (onMoveDownloadFileListener == null) {
        return;
    }
    Handler handler = new Handler(Looper.getMainLooper());
    handler.post(new Runnable() {
        @Override
        public void run() {
            if (onMoveDownloadFileListener == null) {
                return;
            }
            onMoveDownloadFileListener.onMoveDownloadFileFailed(downloadFileInfo, failReason);
        }
    });
}
 
开发者ID:wlfcolin,项目名称:file-downloader,代码行数:23,代码来源:OnMoveDownloadFileListener.java

示例13: notifyFailed

import org.wlf.filedownloader.DownloadFileInfo; //导入依赖的package包/类
/**
 * notifyFailed
 */
private void notifyFailed(DownloadFileInfo downloadFileInfo, MoveDownloadFileFailReason failReason) {
    if (mIsNotifyFinish.get()) {
        return;
    }
    if (mIsNotifyFinish.compareAndSet(false, true)) {
        if (mOnMoveDownloadFileListener != null) {
            if (mIsSyncCallback) {
                mOnMoveDownloadFileListener.onMoveDownloadFileFailed(downloadFileInfo, failReason);
            } else {
                OnMoveDownloadFileListener.MainThreadHelper.onMoveDownloadFileFailed(downloadFileInfo,
                        failReason, mOnMoveDownloadFileListener);
            }
        }
    }
}
 
开发者ID:wlfcolin,项目名称:file-downloader,代码行数:19,代码来源:MoveDownloadFileTask.java

示例14: onRenameDownloadFileSuccess

import org.wlf.filedownloader.DownloadFileInfo; //导入依赖的package包/类
/**
 * rename succeed
 *
 * @param downloadFileRenamed download files renamed
 */
public static void onRenameDownloadFileSuccess(final DownloadFileInfo downloadFileRenamed, final 
OnRenameDownloadFileListener onRenameDownloadFileListener) {
    if (onRenameDownloadFileListener == null) {
        return;
    }
    Handler handler = new Handler(Looper.getMainLooper());
    handler.post(new Runnable() {
        @Override
        public void run() {
            if (onRenameDownloadFileListener == null) {
                return;
            }
            onRenameDownloadFileListener.onRenameDownloadFileSuccess(downloadFileRenamed);
        }
    });
}
 
开发者ID:wlfcolin,项目名称:file-downloader,代码行数:22,代码来源:OnRenameDownloadFileListener.java

示例15: onRenameDownloadFileFailed

import org.wlf.filedownloader.DownloadFileInfo; //导入依赖的package包/类
/**
 * rename failed
 *
 * @param downloadFileInfo download files needed to rename
 * @param failReason       fail reason
 */
public static void onRenameDownloadFileFailed(final DownloadFileInfo downloadFileInfo, final 
RenameDownloadFileFailReason failReason, final OnRenameDownloadFileListener onRenameDownloadFileListener) {
    if (onRenameDownloadFileListener == null) {
        return;
    }
    Handler handler = new Handler(Looper.getMainLooper());
    handler.post(new Runnable() {
        @Override
        public void run() {
            if (onRenameDownloadFileListener == null) {
                return;
            }
            onRenameDownloadFileListener.onRenameDownloadFileFailed(downloadFileInfo, failReason);
        }
    });
}
 
开发者ID:wlfcolin,项目名称:file-downloader,代码行数:23,代码来源:OnRenameDownloadFileListener.java


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