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


Java BoxCacheableRequest类代码示例

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


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

示例1: execute

import com.box.androidsdk.content.requests.BoxCacheableRequest; //导入依赖的package包/类
@Override
public void execute(BoxRequest request) {
    if (request == null) {
        return;
    }
    if (BoxConfig.getCache() != null && request instanceof BoxCacheableRequest){
        try {
            BoxFutureTask cacheTask = ((BoxCacheableRequest) request).toTaskForCachedResult();
            if (mListener != null){
                cacheTask.addOnCompletedListener(mListener);
            }
            getApiExecutor().execute(cacheTask);
        } catch (BoxException e){
            BoxLogUtils.e("cache task error ", e);
        }

    }
    BoxFutureTask task = request.toTask();
    if (mListener != null) {
        task.addOnCompletedListener(mListener);
    }

    // Thumbnail request should be executed in their own executor pool
    ThreadPoolExecutor executor = request instanceof BoxRequestsFile.DownloadThumbnail ?
            getThumbnailExecutor() :
            getApiExecutor();
    executor.submit(task);
}
 
开发者ID:box,项目名称:box-android-browse-sdk,代码行数:29,代码来源:BoxBrowseController.java

示例2: get

import com.box.androidsdk.content.requests.BoxCacheableRequest; //导入依赖的package包/类
@Override
public <T extends BoxObject, R extends BoxRequest & BoxCacheableRequest> T get(R request) throws BoxException {

    if (request instanceof BoxRequestsFolder.GetFolderWithAllItems){
        // Assume fields have not changed.
        return (T)mFullFolderCache.get(((BoxRequestsFolder.GetFolderWithAllItems) request).getId());
    }
    return null;
}
 
开发者ID:box,项目名称:box-android-browse-sdk,代码行数:10,代码来源:BoxSimpleLocalCache.java

示例3: get

import com.box.androidsdk.content.requests.BoxCacheableRequest; //导入依赖的package包/类
/**
 * Returns the last cached BoxObject for this BoxRequest.
 * @param request - The BoxRequest object that can be used for fetching remote data.
 * @param <T> A child of BoxObject
 * @param <R> A child of BoxRequest that implements BoxCacheableRequest
 * @return a BoxObject associated with the request type.
 * @throws BoxException thrown if the request fails.
 */
<T extends BoxObject, R extends BoxRequest & BoxCacheableRequest> T get(R request) throws BoxException;
 
开发者ID:box,项目名称:box-android-sdk,代码行数:10,代码来源:BoxCache.java


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