本文整理汇总了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;
}
示例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;
}
}
}
示例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;
}
示例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;
}
示例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());
}
示例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());
}
示例7: totalDownloadSize
import org.fdroid.fdroid.net.bluetooth.FileDetails; //导入依赖的package包/类
@Override
public int totalDownloadSize() {
FileDetails details = getFileDetails();
return details != null ? details.getFileSize() : -1;
}
示例8: handle
import org.fdroid.fdroid.net.bluetooth.FileDetails; //导入依赖的package包/类
public void handle(FileDetails details, String value) {
details.setFileSize(Integer.parseInt(value));
}
示例9: handle
import org.fdroid.fdroid.net.bluetooth.FileDetails; //导入依赖的package包/类
public void handle(FileDetails details, String value) {
details.setCacheTag(value);
}
示例10: handle
import org.fdroid.fdroid.net.bluetooth.FileDetails; //导入依赖的package包/类
protected abstract void handle(FileDetails details, String value);