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


Java FileDetails类代码示例

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


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

示例1: getFileDetails

import org.fdroid.fdroid.net.bluetooth.FileDetails; //导入依赖的package包/类
/**
 * May return null if an error occurred while getting file details.
 */
@Nullable
private FileDetails getFileDetails() {
    if (fileDetails == null) {
        Utils.debugLog(TAG, "Going to Bluetooth \"server\" to get file details.");
        try {
            fileDetails = Request.createHEAD(sourceUrl.getPath(), connection).send().toFileDetails();
        } catch (IOException e) {
            Log.e(TAG, "Error getting file details from Bluetooth \"server\"", e);
        }
    }
    return fileDetails;
}
 
开发者ID:uhuru-mobile,项目名称:mobile-store,代码行数:16,代码来源:BluetoothDownloader.java

示例2: process

import org.fdroid.fdroid.net.bluetooth.FileDetails; //导入依赖的package包/类
public static void process(FileDetails details, String header, String value) {
    header = header.toLowerCase(Locale.ENGLISH);
    for (Header potentialHeader : VALID_HEADERS) {
        if (potentialHeader.getName().equals(header)) {
            potentialHeader.handle(details, value);
            break;
        }
    }
}
 
开发者ID:uhuru-mobile,项目名称:mobile-store,代码行数:10,代码来源:Header.java

示例3: toFileDetails

import org.fdroid.fdroid.net.bluetooth.FileDetails; //导入依赖的package包/类
/**
 * Extracts meaningful headers from the response into a more useful and safe
 * {@link org.fdroid.fdroid.net.bluetooth.FileDetails} object.
 */
public FileDetails toFileDetails() {
    FileDetails details = new FileDetails();
    for (Map.Entry<String, String> entry : headers.entrySet()) {
        Header.process(details, entry.getKey(), entry.getValue());
    }
    return details;
}
 
开发者ID:uhuru-mobile,项目名称:mobile-store,代码行数:12,代码来源:Response.java

示例4: getFileDetails

import org.fdroid.fdroid.net.bluetooth.FileDetails; //导入依赖的package包/类
/**
 * May return null if an error occurred while getting file details.
 */
@Nullable
public FileDetails getFileDetails() {
    if (fileDetails == null) {
        Utils.debugLog(TAG, "Going to Bluetooth \"server\" to get file details.");
        try {
            fileDetails = Request.createHEAD(sourceUrl.getPath(), connection).send().toFileDetails();
        } catch (IOException e) {
            Log.e(TAG, "Error getting file details from Bluetooth \"server\"", e);
        }
    }
    return fileDetails;
}
 
开发者ID:CmDnoEdition,项目名称:fdroid,代码行数:16,代码来源:BluetoothDownloader.java

示例5: isCached

import org.fdroid.fdroid.net.bluetooth.FileDetails; //导入依赖的package包/类
@Override
public boolean isCached() {
    FileDetails details = getFileDetails();
    return details != null &&
        details.getCacheTag() != null &&
        details.getCacheTag().equals(getCacheTag());
}
 
开发者ID:CmDnoEdition,项目名称:fdroid,代码行数:8,代码来源:BluetoothDownloader.java

示例6: hasChanged

import org.fdroid.fdroid.net.bluetooth.FileDetails; //导入依赖的package包/类
@Override
public boolean hasChanged() {
    FileDetails details = getFileDetails();
    return details == null || details.getCacheTag() == null || details.getCacheTag().equals(getCacheTag());
}
 
开发者ID:uhuru-mobile,项目名称:mobile-store,代码行数:6,代码来源:BluetoothDownloader.java

示例7: totalDownloadSize

import org.fdroid.fdroid.net.bluetooth.FileDetails; //导入依赖的package包/类
@Override
public int totalDownloadSize() {
    FileDetails details = getFileDetails();
    return details != null ? details.getFileSize() : -1;
}
 
开发者ID:uhuru-mobile,项目名称:mobile-store,代码行数:6,代码来源:BluetoothDownloader.java

示例8: handle

import org.fdroid.fdroid.net.bluetooth.FileDetails; //导入依赖的package包/类
public void handle(FileDetails details, String value) {
    details.setFileSize(Integer.parseInt(value));
}
 
开发者ID:uhuru-mobile,项目名称:mobile-store,代码行数:4,代码来源:ContentLengthHeader.java

示例9: handle

import org.fdroid.fdroid.net.bluetooth.FileDetails; //导入依赖的package包/类
public void handle(FileDetails details, String value) {
    details.setCacheTag(value);
}
 
开发者ID:uhuru-mobile,项目名称:mobile-store,代码行数:4,代码来源:ETagHeader.java

示例10: handle

import org.fdroid.fdroid.net.bluetooth.FileDetails; //导入依赖的package包/类
protected abstract void handle(FileDetails details, String value); 
开发者ID:uhuru-mobile,项目名称:mobile-store,代码行数:2,代码来源:Header.java


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