Added dependency injections for FileUtils and removed redundant code

This commit is contained in:
Ernir Erlingsson
2015-12-10 10:49:28 +01:00
parent fb2a44c478
commit a5fd7ff9dc
12 changed files with 41 additions and 70 deletions

View File

@@ -1,17 +0,0 @@
package org.briarproject.system;
import java.io.File;
import java.io.IOException;
import org.briarproject.api.system.FileUtils;
class DesktopFileUtils implements FileUtils {
public long getTotalSpace(File f) throws IOException {
return f.getTotalSpace(); // Requires Java 1.6
}
public long getFreeSpace(File f) throws IOException {
return f.getUsableSpace(); // Requires Java 1.6
}
}

View File

@@ -15,6 +15,6 @@ public class DesktopSystemModule extends AbstractModule {
bind(Timer.class).to(SystemTimer.class);
if (OsUtils.isLinux())
bind(SeedProvider.class).to(LinuxSeedProvider.class);
bind(FileUtils.class).to(DesktopFileUtils.class);
bind(FileUtils.class).to(FileUtilsImpl.class);
}
}