本文整理了Java中org.apache.commons.io.FileUtils.sizeOf0()
方法的一些代码示例,展示了FileUtils.sizeOf0()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FileUtils.sizeOf0()
方法的具体详情如下:
包路径:org.apache.commons.io.FileUtils
类名称:FileUtils
方法名:sizeOf0
[英]the size of a file
[中]文件的大小
代码示例来源:origin: commons-io/commons-io
/**
* the size of a director
* @param directory the directory to check
* @return the size
*/
private static long sizeOfDirectory0(final File directory) {
final File[] files = directory.listFiles();
if (files == null) { // null if security restricted
return 0L;
}
long size = 0;
for (final File file : files) {
try {
if (!isSymlink(file)) {
size += sizeOf0(file); // internal method
if (size < 0) {
break;
}
}
} catch (final IOException ioe) {
// Ignore exceptions caught when asking if a File is a symlink.
}
}
return size;
}
代码示例来源:origin: io.github.stephenc.docker/docker-client-shaded
/**
* the size of a director
* @param directory the directory to check
* @return the size
*/
private static long sizeOfDirectory0(final File directory) {
final File[] files = directory.listFiles();
if (files == null) { // null if security restricted
return 0L;
}
long size = 0;
for (final File file : files) {
try {
if (!isSymlink(file)) {
size += sizeOf0(file); // internal method
if (size < 0) {
break;
}
}
} catch (final IOException ioe) {
// Ignore exceptions caught when asking if a File is a symlink.
}
}
return size;
}
代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded
/**
* the size of a director
* @param directory the directory to check
* @return the size
*/
private static long sizeOfDirectory0(final File directory) {
final File[] files = directory.listFiles();
if (files == null) { // null if security restricted
return 0L;
}
long size = 0;
for (final File file : files) {
try {
if (!isSymlink(file)) {
size += sizeOf0(file); // internal method
if (size < 0) {
break;
}
}
} catch (final IOException ioe) {
// Ignore exceptions caught when asking if a File is a symlink.
}
}
return size;
}
内容来源于网络,如有侵权,请联系作者删除!