in src/main/java/com/googlesource/gerrit/plugins/quota/MaxRepositorySizeQuota.java [150:165]
private static long getDiskUsage(File dir) throws IOException {
final MutableLong size = new MutableLong();
Files.walkFileTree(
dir.toPath(),
new SimpleFileVisitor<Path>() {
@Override
public FileVisitResult visitFile(Path path, BasicFileAttributes attrs)
throws IOException {
if (attrs.isRegularFile()) {
size.add(attrs.size());
}
return FileVisitResult.CONTINUE;
}
});
return size.longValue();
}