Use commons-io to measure free space.

This commit is contained in:
akwizgran
2011-07-14 19:21:16 +01:00
parent cea8a3a843
commit b41465c2da
2 changed files with 6 additions and 3 deletions

View File

@@ -55,7 +55,8 @@ class H2Database extends JdbcDatabase {
public long getFreeSpace() throws DbException {
try {
File dir = home.getParentFile();
long free = FileSystemUtils.freeSpaceKb(dir.getAbsolutePath());
String path = dir.getAbsolutePath();
long free = FileSystemUtils.freeSpaceKb(path) * 1024L;
long used = getDiskSpace(dir);
long quota = maxSize - used;
long min = Math.min(free, quota);