mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-21 15:19:53 +01:00
Skip special files (symlinks etc) when calculating disk space.
This commit is contained in:
@@ -70,11 +70,15 @@ class H2Database extends JdbcDatabase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private long getDiskSpace(File f) {
|
private long getDiskSpace(File f) {
|
||||||
long total = 0;
|
|
||||||
if(f.isDirectory()) {
|
if(f.isDirectory()) {
|
||||||
|
long total = 0;
|
||||||
for(File child : f.listFiles()) total += getDiskSpace(child);
|
for(File child : f.listFiles()) total += getDiskSpace(child);
|
||||||
return total;
|
return total;
|
||||||
} else return f.length();
|
} else if(f.isFile()) {
|
||||||
|
return f.length();
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Connection createConnection() throws SQLException {
|
protected Connection createConnection() throws SQLException {
|
||||||
|
|||||||
Reference in New Issue
Block a user