org.apache.commons.io.FileUtils.sizeOfDirectory0()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(3.5k)|赞(0)|评价(0)|浏览(163)

本文整理了Java中org.apache.commons.io.FileUtils.sizeOfDirectory0()方法的一些代码示例,展示了FileUtils.sizeOfDirectory0()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FileUtils.sizeOfDirectory0()方法的具体详情如下:
包路径:org.apache.commons.io.FileUtils
类名称:FileUtils
方法名:sizeOfDirectory0

FileUtils.sizeOfDirectory0介绍

[英]the size of a director
[中]董事的身材

代码示例

代码示例来源:origin: commons-io/commons-io

/**
 * the size of a file
 * @param file the file to check
 * @return the size of the file
 */
private static long sizeOf0(final File file) {
  if (file.isDirectory()) {
    return sizeOfDirectory0(file);
  } else {
    return file.length(); // will be 0 if file does not exist
  }
}

代码示例来源:origin: commons-io/commons-io

/**
 * Counts the size of a directory recursively (sum of the length of all files).
 * <p>
 * Note that overflow is not detected, and the return value may be negative if
 * overflow occurs. See {@link #sizeOfDirectoryAsBigInteger(File)} for an alternative
 * method that does not overflow.
 *
 * @param directory directory to inspect, must not be {@code null}
 * @return size of directory in bytes, 0 if directory is security restricted, a negative number when the real total
 * is greater than {@link Long#MAX_VALUE}.
 * @throws NullPointerException if the directory is {@code null}
 */
public static long sizeOfDirectory(final File directory) {
  checkDirectory(directory);
  return sizeOfDirectory0(directory);
}

代码示例来源:origin: commons-io/commons-io

return sizeOfDirectory0(file); // private method; expects directory
} else {
  return file.length();

代码示例来源:origin: io.github.stephenc.docker/docker-client-shaded

/**
 * the size of a file
 * @param file the file to check
 * @return the size of the fil
 */
private static long sizeOf0(File file) {
  if (file.isDirectory()) {
    return sizeOfDirectory0(file);
  } else {
    return file.length(); // will be 0 if file does not exist
  }
}

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

/**
 * the size of a file
 * @param file the file to check
 * @return the size of the file
 */
private static long sizeOf0(final File file) {
  if (file.isDirectory()) {
    return sizeOfDirectory0(file);
  } else {
    return file.length(); // will be 0 if file does not exist
  }
}

代码示例来源:origin: io.github.stephenc.docker/docker-client-shaded

/**
 * Counts the size of a directory recursively (sum of the length of all files).
 * <p>
 * Note that overflow is not detected, and the return value may be negative if
 * overflow occurs. See {@link #sizeOfDirectoryAsBigInteger(File)} for an alternative
 * method that does not overflow.
 *
 * @param directory directory to inspect, must not be {@code null}
 * @return size of directory in bytes, 0 if directory is security restricted, a negative number when the real total
 * is greater than {@link Long#MAX_VALUE}.
 * @throws NullPointerException if the directory is {@code null}
 */
public static long sizeOfDirectory(final File directory) {
  checkDirectory(directory);
  return sizeOfDirectory0(directory);
}

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

/**
 * Counts the size of a directory recursively (sum of the length of all files).
 * <p>
 * Note that overflow is not detected, and the return value may be negative if
 * overflow occurs. See {@link #sizeOfDirectoryAsBigInteger(File)} for an alternative
 * method that does not overflow.
 *
 * @param directory directory to inspect, must not be {@code null}
 * @return size of directory in bytes, 0 if directory is security restricted, a negative number when the real total
 * is greater than {@link Long#MAX_VALUE}.
 * @throws NullPointerException if the directory is {@code null}
 */
public static long sizeOfDirectory(final File directory) {
  checkDirectory(directory);
  return sizeOfDirectory0(directory);
}

代码示例来源:origin: io.github.stephenc.docker/docker-client-shaded

return sizeOfDirectory0(file); // private method; expects directory
} else {
  return file.length();

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

return sizeOfDirectory0(file); // private method; expects directory
} else {
  return file.length();

相关文章

FileUtils类方法