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


Java OnDownloadFileChangeListener类代码示例

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


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

示例1: removeOnDownloadFileChangeListener

import org.wlf.filedownloader.listener.OnDownloadFileChangeListener; //导入依赖的package包/类
/**
 * remove a OnDownloadFileChangeListener
 *
 * @param onDownloadFileChangeListener added OnDownloadFileChangeListener impl
 */
public void removeOnDownloadFileChangeListener(OnDownloadFileChangeListener onDownloadFileChangeListener) {
    if (onDownloadFileChangeListener == null) {
        return;
    }
    // find and remove
    for (DownloadFileChangeListenerInfo listenerInfo : mOnDownloadFileChangeListeners) {
        if (listenerInfo == null) {
            continue;
        }
        if (listenerInfo.mListener == onDownloadFileChangeListener) {
            // find, remove
            mOnDownloadFileChangeListeners.remove(listenerInfo);

            String urls = (listenerInfo.mDownloadFileChangeConfiguration != null && !CollectionUtil.isEmpty
                    (listenerInfo.mDownloadFileChangeConfiguration.getListenUrls())) ? listenerInfo
                    .mDownloadFileChangeConfiguration.getListenUrls().toString() : "all";

            Log.i(TAG, "file-downloader-listener 移除【下载文件改变监听器】成功,该listener监听的urls:" + urls);

            break;
        }
    }
}
 
开发者ID:wlfcolin,项目名称:file-downloader,代码行数:29,代码来源:DownloadFileChangeObserver.java

示例2: notifyDownloadFileCreated

import org.wlf.filedownloader.listener.OnDownloadFileChangeListener; //导入依赖的package包/类
/**
 * notifyDownloadFileCreated
 */
private void notifyDownloadFileCreated(DownloadFileInfo downloadFileInfo, OnDownloadFileChangeListener listener, 
                                       boolean sync) {
    // notify caller
    if (sync) {
        // sync notify caller
        try {
            if (listener != null) {
                listener.onDownloadFileCreated(downloadFileInfo);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    } else {
        // main thread notify caller
        OnDownloadFileChangeListener.MainThreadHelper.onDownloadFileCreated(downloadFileInfo, listener);
    }

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

    Log.i(TAG, "file-downloader-listener 通知【下载文件被创建】,被创建文件的url:" + url);
}
 
开发者ID:wlfcolin,项目名称:file-downloader,代码行数:25,代码来源:DownloadFileChangeObserver.java

示例3: notifyDownloadFileUpdated

import org.wlf.filedownloader.listener.OnDownloadFileChangeListener; //导入依赖的package包/类
/**
 * notifyDownloadFileUpdated
 */
private void notifyDownloadFileUpdated(DownloadFileInfo downloadFileInfo, Type type, OnDownloadFileChangeListener
        listener, boolean sync) {
    // notify caller
    if (sync) {
        // sync notify caller
        try {
            if (listener != null) {
                listener.onDownloadFileUpdated(downloadFileInfo, type);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    } else {
        // main thread notify caller
        OnDownloadFileChangeListener.MainThreadHelper.onDownloadFileUpdated(downloadFileInfo, type, listener);
    }

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

    Log.i(TAG, "file-downloader-listener 通知【下载文件被更新】,更新类型:" + typeName + ",被更新文件的url:" + url);
}
 
开发者ID:wlfcolin,项目名称:file-downloader,代码行数:26,代码来源:DownloadFileChangeObserver.java

示例4: notifyDownloadFileDeleted

import org.wlf.filedownloader.listener.OnDownloadFileChangeListener; //导入依赖的package包/类
/**
 * notifyDownloadFileDeleted
 */
private void notifyDownloadFileDeleted(DownloadFileInfo downloadFileInfo, OnDownloadFileChangeListener listener, 
                                       boolean sync) {
    // notify caller
    if (sync) {
        // sync notify caller
        try {
            if (listener != null) {
                listener.onDownloadFileDeleted(downloadFileInfo);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    } else {
        // main thread caller
        OnDownloadFileChangeListener.MainThreadHelper.onDownloadFileDeleted(downloadFileInfo, listener);
    }
    String url = downloadFileInfo != null ? downloadFileInfo.getUrl() : "unknown";

    Log.i(TAG, "file-downloader-listener 通知【下载文件被删除】,被删除文件的url:" + url);
}
 
开发者ID:wlfcolin,项目名称:file-downloader,代码行数:24,代码来源:DownloadFileChangeObserver.java

示例5: DownloadFileChangeListenerInfo

import org.wlf.filedownloader.listener.OnDownloadFileChangeListener; //导入依赖的package包/类
public DownloadFileChangeListenerInfo(DownloadFileChangeConfiguration downloadFileChangeConfiguration, 
                                      OnDownloadFileChangeListener listener) {
    mDownloadFileChangeConfiguration = downloadFileChangeConfiguration;
    mListener = listener;
}
 
开发者ID:wlfcolin,项目名称:file-downloader,代码行数:6,代码来源:DownloadFileChangeObserver.java

示例6: registerDownloadFileChangeListener

import org.wlf.filedownloader.listener.OnDownloadFileChangeListener; //导入依赖的package包/类
/**
 * register a DownloadFileChangeListener with Configuration
 *
 * @param onDownloadFileChangeListener    OnDownloadFileChangeListener impl
 * @param downloadFileChangeConfiguration Configuration for the OnDownloadFileChangeListener impl
 * @since 0.3.0
 */
public static void registerDownloadFileChangeListener(OnDownloadFileChangeListener onDownloadFileChangeListener, 
                                                      DownloadFileChangeConfiguration 
                                                              downloadFileChangeConfiguration) {
    getFileDownloadManager().registerDownloadFileChangeListener(onDownloadFileChangeListener, 
            downloadFileChangeConfiguration);
}
 
开发者ID:wlfcolin,项目名称:file-downloader,代码行数:14,代码来源:FileDownloader.java

示例7: unregisterDownloadFileChangeListener

import org.wlf.filedownloader.listener.OnDownloadFileChangeListener; //导入依赖的package包/类
/**
 * unregister an OnDownloadFileChangeListener
 *
 * @param onDownloadFileChangeListener registered OnDownloadFileChangeListener impl
 */
public static void unregisterDownloadFileChangeListener(OnDownloadFileChangeListener onDownloadFileChangeListener) {
    getFileDownloadManager().unregisterDownloadFileChangeListener(onDownloadFileChangeListener);
}
 
开发者ID:wlfcolin,项目名称:file-downloader,代码行数:9,代码来源:FileDownloader.java

示例8: registerDownloadFileChangeListener

import org.wlf.filedownloader.listener.OnDownloadFileChangeListener; //导入依赖的package包/类
/**
 * register a DownloadFileChangeListener with Configuration
 *
 * @param onDownloadFileChangeListener    OnDownloadFileChangeListener impl
 * @param downloadFileChangeConfiguration Configuration for the OnDownloadFileChangeListener impl
 * @since 0.3.0
 */
void registerDownloadFileChangeListener(OnDownloadFileChangeListener onDownloadFileChangeListener, 
                                        DownloadFileChangeConfiguration downloadFileChangeConfiguration) {
    mDownloadFileCacher.registerDownloadFileChangeListener(onDownloadFileChangeListener, 
            downloadFileChangeConfiguration);
}
 
开发者ID:wlfcolin,项目名称:file-downloader,代码行数:13,代码来源:FileDownloadManager.java

示例9: unregisterDownloadFileChangeListener

import org.wlf.filedownloader.listener.OnDownloadFileChangeListener; //导入依赖的package包/类
/**
 * unregister an OnDownloadFileChangeListener
 *
 * @param onDownloadFileChangeListener registered OnDownloadFileChangeListener impl
 * @since 0.3.0
 */
void unregisterDownloadFileChangeListener(OnDownloadFileChangeListener onDownloadFileChangeListener) {
    mDownloadFileCacher.unregisterDownloadFileChangeListener(onDownloadFileChangeListener);
}
 
开发者ID:wlfcolin,项目名称:file-downloader,代码行数:10,代码来源:FileDownloadManager.java

示例10: registerDownloadFileChangeListener

import org.wlf.filedownloader.listener.OnDownloadFileChangeListener; //导入依赖的package包/类
/**
 * register a DownloadFileChangeListener with Configuration
 *
 * @param onDownloadFileChangeListener    OnDownloadFileChangeListener impl
 * @param downloadFileChangeConfiguration Configuration for the OnDownloadFileChangeListener impl
 * @since 0.3.0
 */
public void registerDownloadFileChangeListener(OnDownloadFileChangeListener onDownloadFileChangeListener, 
                                               DownloadFileChangeConfiguration downloadFileChangeConfiguration) {
    mDownloadFileChangeObserver.addOnDownloadFileChangeListener(onDownloadFileChangeListener, 
            downloadFileChangeConfiguration);
}
 
开发者ID:wlfcolin,项目名称:file-downloader,代码行数:13,代码来源:DownloadCacher.java

示例11: unregisterDownloadFileChangeListener

import org.wlf.filedownloader.listener.OnDownloadFileChangeListener; //导入依赖的package包/类
/**
 * unregister an OnDownloadFileChangeListener
 *
 * @param onDownloadFileChangeListener registered OnDownloadFileChangeListener impl
 */
public void unregisterDownloadFileChangeListener(OnDownloadFileChangeListener onDownloadFileChangeListener) {
    mDownloadFileChangeObserver.removeOnDownloadFileChangeListener(onDownloadFileChangeListener);
}
 
开发者ID:wlfcolin,项目名称:file-downloader,代码行数:9,代码来源:DownloadCacher.java


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