本文整理汇总了Java中info.guardianproject.iocipher.File.listFiles方法的典型用法代码示例。如果您正苦于以下问题:Java File.listFiles方法的具体用法?Java File.listFiles怎么用?Java File.listFiles使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类info.guardianproject.iocipher.File
的用法示例。
在下文中一共展示了File.listFiles方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadOmemoPreKeys
import info.guardianproject.iocipher.File; //导入方法依赖的package包/类
@Override
public HashMap<Integer, T_PreKey> loadOmemoPreKeys(OmemoManager omemoManager) {
File preKeyDirectory = hierarchy.getPreKeysDirectory(omemoManager);
HashMap<Integer, T_PreKey> preKeys = new HashMap<>();
if (preKeyDirectory == null) {
return preKeys;
}
File[] keys = preKeyDirectory.listFiles();
for (File f : keys != null ? keys : new File[0]) {
try {
byte[] bytes = readBytes(f);
if (bytes == null) {
continue;
}
T_PreKey p = keyUtil().preKeyFromBytes(bytes);
preKeys.put(Integer.parseInt(f.getName()), p);
} catch (IOException e) {
//Do nothing
}
}
return preKeys;
}
示例2: loadOmemoSignedPreKeys
import info.guardianproject.iocipher.File; //导入方法依赖的package包/类
@Override
public HashMap<Integer, T_SigPreKey> loadOmemoSignedPreKeys(OmemoManager omemoManager) {
File signedPreKeysDirectory = hierarchy.getSignedPreKeysDirectory(omemoManager);
HashMap<Integer, T_SigPreKey> signedPreKeys = new HashMap<>();
if (signedPreKeysDirectory == null) {
return signedPreKeys;
}
File[] keys = signedPreKeysDirectory.listFiles();
for (File f : keys != null ? keys : new File[0]) {
try {
byte[] bytes = readBytes(f);
if (bytes == null) {
continue;
}
T_SigPreKey p = keyUtil().signedPreKeyFromBytes(bytes);
signedPreKeys.put(Integer.parseInt(f.getName()), p);
} catch (IOException e) {
//Do nothing
}
}
return signedPreKeys;
}
示例3: addTree
import info.guardianproject.iocipher.File; //导入方法依赖的package包/类
public static void addTree(File file, Collection<File> all) {
File[] children = file.listFiles();
if (children != null) {
for (File child : children) {
all.add(child);
addTree(child, all);
}
}
}
示例4: isFreshInstallation
import info.guardianproject.iocipher.File; //导入方法依赖的package包/类
@Override
public boolean isFreshInstallation(OmemoManager omemoManager) {
File userDirectory = hierarchy.getUserDeviceDirectory(omemoManager);
File[] files = userDirectory.listFiles();
return files == null || files.length == 0;
}