Reorganised Guice modules. Contribute entropy to pool on Linux/Android.

This commit is contained in:
akwizgran
2014-01-14 19:33:17 +00:00
parent 46863b8c1b
commit 8886d954d7
45 changed files with 327 additions and 178 deletions

View File

@@ -0,0 +1,27 @@
package org.briarproject.system;
import java.io.File;
import java.io.IOException;
import org.briarproject.api.system.Clock;
import org.briarproject.api.system.FileUtils;
import org.briarproject.api.system.SeedProvider;
import org.briarproject.api.system.Timer;
import org.briarproject.util.OsUtils;
import com.google.inject.AbstractModule;
public class DesktopSystemModule extends AbstractModule {
protected void configure() {
bind(Clock.class).to(SystemClock.class);
bind(Timer.class).to(SystemTimer.class);
if(OsUtils.isLinux())
bind(SeedProvider.class).to(LinuxSeedProvider.class);
bind(FileUtils.class).toInstance(new FileUtils() {
public long getFreeSpace(File f) throws IOException {
return f.getFreeSpace();
}
});
}
}