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


Java DownloadFileInfo.getUrl方法代码示例

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


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

示例1: onFileDownloadStatusWaiting

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

    if (downloadFileInfo == null) {
        return;
    }

    // add
    if (addNewDownloadFileInfo(downloadFileInfo)) {
        // add succeed
        notifyDataSetChanged();
    } else {
        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__waiting));

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

示例2: onFileDownloadStatusRetrying

import org.wlf.filedownloader.DownloadFileInfo; //导入方法依赖的package包/类
@Override
public void onFileDownloadStatusRetrying(DownloadFileInfo downloadFileInfo, int retryTimes) {

    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__retrying_connect_resource) + "(" +
                retryTimes + ")");

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

示例3: 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

示例4: 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

示例5: onMoveDownloadFileFailed

import org.wlf.filedownloader.DownloadFileInfo; //导入方法依赖的package包/类
@Override
public void onMoveDownloadFileFailed(DownloadFileInfo downloadFileInfo, MoveDownloadFileFailReason failReason) {

    String url = null;
    if (downloadFileInfo != null) {
        url = downloadFileInfo.getUrl();
    }

    String msg = null;
    if (failReason != null) {
        msg = failReason.getMessage();
    }

    Log.d(TAG, TAG + ".run 移动单个成功,已移动数量:" + mDownloadFilesMoved.size() + ",总共需要移动数量" +
            mDownloadFilesNeedMove.size() + ",失败原因:" + msg + ",url:" + url);

    synchronized (mLock) {// lock
        // move failed
        mDownloadFilesSkip.add(downloadFileInfo);
    }

    if (mDownloadFilesMoved.size() + mDownloadFilesSkip.size() == mDownloadFilesNeedMove.size()) {
        // complete, notify caller
        notifyMoveDownloadFilesCompleted();
    }
}
 
开发者ID:wlfcolin,项目名称:file-downloader,代码行数:27,代码来源:MoveDownloadFilesTask.java

示例6: onMoveDownloadFileSuccess

import org.wlf.filedownloader.DownloadFileInfo; //导入方法依赖的package包/类
@Override
public void onMoveDownloadFileSuccess(DownloadFileInfo downloadFileMoved) {

    String url = null;
    if (downloadFileMoved != null) {
        url = downloadFileMoved.getUrl();
    }

    synchronized (mLock) {// lock
        // move succeed
        mDownloadFilesMoved.add(downloadFileMoved);
    }

    Log.d(TAG, TAG + ".run 移动单个成功,已移动数量:" + mDownloadFilesMoved.size() + ",总共需要移动数量" +
            mDownloadFilesNeedMove.size() + ",url:" + url);

    if (mDownloadFilesMoved.size() + mDownloadFilesSkip.size() == mDownloadFilesNeedMove.size()) {
        // complete, notify caller
        notifyMoveDownloadFilesCompleted();
    }
}
 
开发者ID:wlfcolin,项目名称:file-downloader,代码行数:22,代码来源:MoveDownloadFilesTask.java

示例7: onFileDownloadStatusPreparing

import org.wlf.filedownloader.DownloadFileInfo; //导入方法依赖的package包/类
@Override
public void onFileDownloadStatusPreparing(DownloadFileInfo downloadFileInfo) {
    // 准备中(即,正在连接资源)
    DownloadTask downloadTask = new DownloadTask(downloadFileInfo.getUrl().hashCode() , downloadFileInfo.getUrl() , downloadFileInfo.getFilePath() ,
            downloadFileInfo.getFileSizeLong() , downloadFileInfo.getDownloadedSizeLong() , System.currentTimeMillis());
    if(mDownloadChangedListener != null){
        mDownloadChangedListener.update(downloadTask);
    }
}
 
开发者ID:zhuangzaiku,项目名称:AndroidCollection,代码行数:10,代码来源:WCFileDownloader.java

示例8: onFileDownloadStatusCompleted

import org.wlf.filedownloader.DownloadFileInfo; //导入方法依赖的package包/类
@Override
public void onFileDownloadStatusCompleted(DownloadFileInfo downloadFileInfo) {
    // 下载完成(整个文件已经全部下载完成)
    DownloadTask downloadTask = new DownloadTask(downloadFileInfo.getUrl().hashCode() , downloadFileInfo.getUrl() , downloadFileInfo.getFilePath() ,
            downloadFileInfo.getFileSizeLong() , downloadFileInfo.getDownloadedSizeLong() ,-1);
    downloadTask.setFinish(true);
    if(mDownloadChangedListener != null){
        mDownloadChangedListener.update(downloadTask);
    }
    File file = new File(downloadFileInfo.getFilePath());
    if(file != null && file.exists()){
        file.delete();
    }
}
 
开发者ID:zhuangzaiku,项目名称:AndroidCollection,代码行数:15,代码来源:WCFileDownloader.java

示例9: onFileDownloadStatusFailed

import org.wlf.filedownloader.DownloadFileInfo; //导入方法依赖的package包/类
@Override
public void onFileDownloadStatusFailed(String url, DownloadFileInfo downloadFileInfo, FileDownloadStatusFailReason failReason) {
    // 下载失败了,详细查看失败原因failReason,有些失败原因你可能必须关心
    DownloadTask downloadTask = new DownloadTask(downloadFileInfo.getUrl().hashCode() , downloadFileInfo.getUrl() , downloadFileInfo.getFilePath() ,
            downloadFileInfo.getFileSizeLong() , downloadFileInfo.getDownloadedSizeLong() ,-1);
    downloadTask.setFinish(true);
    if(mDownloadChangedListener != null){
        mDownloadChangedListener.update(downloadTask);
    }
    String failType = failReason.getType();
    String failUrl = failReason.getUrl();// 或:failUrl = url,url和failReason.getUrl()会是一样的

    if(FileDownloadStatusFailReason.TYPE_URL_ILLEGAL.equals(failType)){
        // 下载failUrl时出现url错误
    }else if(FileDownloadStatusFailReason.TYPE_STORAGE_SPACE_IS_FULL.equals(failType)){
        // 下载failUrl时出现本地存储空间不足
    }else if(FileDownloadStatusFailReason.TYPE_NETWORK_DENIED.equals(failType)){
        // 下载failUrl时出现无法访问网络
    }else if(FileDownloadStatusFailReason.TYPE_NETWORK_TIMEOUT.equals(failType)){
        // 下载failUrl时出现连接超时
    }else{
        // 更多错误....
    }

    // 查看详细异常信息
    Throwable failCause = failReason.getCause();// 或:failReason.getOriginalCause()

    // 查看异常描述信息
    String failMsg = failReason.getMessage();// 或:failReason.getOriginalCause().getMessage()
}
 
开发者ID:zhuangzaiku,项目名称:AndroidCollection,代码行数:31,代码来源:WCFileDownloader.java

示例10: onDownloadFileUpdated

import org.wlf.filedownloader.DownloadFileInfo; //导入方法依赖的package包/类
@Override
public void onDownloadFileUpdated(DownloadFileInfo downloadFileInfo, Type type) {
    // 一个下载文件被更新,也许你需要同步你自己的数据存储,比如在你的业务数据库中更新一条记录
    DownloadTask downloadTask = new DownloadTask(downloadFileInfo.getUrl().hashCode() , downloadFileInfo.getUrl() , downloadFileInfo.getFilePath() ,
            downloadFileInfo.getFileSizeLong() , downloadFileInfo.getDownloadedSizeLong() ,-1);
    if(mDownloadChangedListener != null){
        mDownloadChangedListener.update(downloadTask);
    }
}
 
开发者ID:zhuangzaiku,项目名称:AndroidCollection,代码行数:10,代码来源:WCFileDownloader.java

示例11: notifyDeletingDownloadFiles

import org.wlf.filedownloader.DownloadFileInfo; //导入方法依赖的package包/类
/**
 * notifyDeletingDownloadFiles
 */
private void notifyDeletingDownloadFiles(DownloadFileInfo downloadFileInfo) {

    String url = null;
    if (downloadFileInfo != null) {
        url = downloadFileInfo.getUrl();
    }

    Log.d(TAG, TAG + ".run 准备删除单个,url:" + url);

    OnDeleteDownloadFilesListener.MainThreadHelper.onDeletingDownloadFiles(mDownloadFilesNeedDelete,
            mDownloadFilesDeleted, mDownloadFilesSkip, downloadFileInfo, mOnDeleteDownloadFilesListener);
}
 
开发者ID:wlfcolin,项目名称:file-downloader,代码行数:16,代码来源:DeleteDownloadFilesTask.java

示例12: onDownloadFileUpdated

import org.wlf.filedownloader.DownloadFileInfo; //导入方法依赖的package包/类
@Override
public void onDownloadFileUpdated(DownloadFileInfo downloadFileInfo, Type type) {

    if (downloadFileInfo != null && downloadFileInfo.getUrl() != null && downloadFileInfo.getUrl().equals
            (mCourseUrl)) {
        if (this.mDownloadFileInfo == null) {
            try {
                if (mCourseDbHelper == null) {
                    return;
                }
                UpdateBuilder builder = mCourseDbHelper.getDao(CoursePreviewInfo.class).updateBuilder();
                builder.where().eq(CoursePreviewInfo.COLUMN_NAME_OF_FIELD_COURSE_URL, downloadFileInfo.getUrl());
                int result = builder.update();
                if (result == 1) {
                    this.mDownloadFileInfo = downloadFileInfo;
                } else {
                    Dao<CoursePreviewInfo, Integer> dao = mCourseDbHelper.getDao(CoursePreviewInfo.class);
                    CreateOrUpdateStatus status = dao.createOrUpdate(this);
                    if (status.isCreated() || status.isUpdated()) {
                        this.mDownloadFileInfo = downloadFileInfo;
                    }
                }
            } catch (SQLException e) {
                e.printStackTrace();
            }
        }
    }

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

示例13: onFileDownloadStatusPrepared

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

    if (!DownloadFileUtil.isLegal(downloadFileInfo)) {
        return;
    }

    String url = downloadFileInfo.getUrl();

    for (DownloadStatusListenerInfo listenerInfo : mDownloadStatusListenerInfos) {

        if (listenerInfo == null || listenerInfo.mListener == null || listenerInfo.mListener == this) {
            continue;
        }

        // notify match url listeners
        if (listenerInfo.mDownloadStatusConfiguration != null && !CollectionUtil.isEmpty(listenerInfo
                .mDownloadStatusConfiguration.getListenUrls())) {
            for (String listenUrl : listenerInfo.mDownloadStatusConfiguration.getListenUrls()) {
                if (!UrlUtil.isUrl(listenUrl)) {
                    continue;
                }
                if (url.equals(listenUrl) || url.trim().equals(listenUrl.trim())) {
                    // find match url, notify caller
                    notifyStatusPrepared(downloadFileInfo, listenerInfo.mListener);
                }
            }
        }
        // Configuration or ListenUrls is null or empty, notify all
        else {
            // global register listener, notify all callers
            notifyStatusPrepared(downloadFileInfo, listenerInfo.mListener);
        }
    }
}
 
开发者ID:wlfcolin,项目名称:file-downloader,代码行数:36,代码来源:DownloadStatusObserver.java

示例14: onDownloadFileCreated

import org.wlf.filedownloader.DownloadFileInfo; //导入方法依赖的package包/类
@Override
public void onDownloadFileCreated(DownloadFileInfo downloadFileInfo) {
    if (downloadFileInfo != null && downloadFileInfo.getUrl() != null && downloadFileInfo.getUrl().equals(mUrl)) {
        this.mDownloadFileInfo = downloadFileInfo;
        Log.e("wlf", "onDownloadFileCreated,downloadFileInfo:" + downloadFileInfo);
    }
}
 
开发者ID:wlfcolin,项目名称:file-downloader,代码行数:8,代码来源:CustomVideoInfo.java

示例15: notifyStatusRetrying

import org.wlf.filedownloader.DownloadFileInfo; //导入方法依赖的package包/类
/**
 * notifyStatusRetrying
 */
private void notifyStatusRetrying(DownloadFileInfo downloadFileInfo, int retryTimes, OnFileDownloadStatusListener
        listener) {
    if (listener instanceof OnRetryableFileDownloadStatusListener) {
        // main thread notify caller
        OnRetryableFileDownloadStatusListener.MainThreadHelper.onFileDownloadStatusRetrying(downloadFileInfo, 
                retryTimes, (OnRetryableFileDownloadStatusListener) listener);

        String url = downloadFileInfo != null ? downloadFileInfo.getUrl() : "unknown";

        Log.i(TAG, "file-downloader-listener 通知【文件下载状态为重试】,重试次数:" + retryTimes + ",文件的url:" + url);
    }
}
 
开发者ID:wlfcolin,项目名称:file-downloader,代码行数:16,代码来源:DownloadStatusObserver.java


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