本文整理汇总了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;
}
}
}
示例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);
}
示例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);
}
示例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);
}
示例5: DownloadFileChangeListenerInfo
import org.wlf.filedownloader.listener.OnDownloadFileChangeListener; //导入依赖的package包/类
public DownloadFileChangeListenerInfo(DownloadFileChangeConfiguration downloadFileChangeConfiguration,
OnDownloadFileChangeListener listener) {
mDownloadFileChangeConfiguration = downloadFileChangeConfiguration;
mListener = listener;
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}