mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-14 03:39:05 +01:00
Added dependency injections for FileUtils and removed redundant code
This commit is contained in:
@@ -1,25 +0,0 @@
|
||||
package org.briarproject.system;
|
||||
|
||||
import org.briarproject.api.system.FileUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
public class AndroidFileUtils implements FileUtils {
|
||||
|
||||
public long getTotalSpace(File f) throws IOException {
|
||||
return f.getTotalSpace();
|
||||
}
|
||||
|
||||
public long getFreeSpace(File f) throws IOException {
|
||||
return f.getUsableSpace();
|
||||
}
|
||||
|
||||
public static void deleteFileOrDir(File f) {
|
||||
if (f.isFile())
|
||||
f.delete();
|
||||
else if (f.isDirectory())
|
||||
for (File child : f.listFiles())
|
||||
deleteFileOrDir(child);
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@ public class AndroidSystemModule extends AbstractModule {
|
||||
bind(Clock.class).to(SystemClock.class);
|
||||
bind(Timer.class).to(SystemTimer.class);
|
||||
bind(SeedProvider.class).to(AndroidSeedProvider.class);
|
||||
bind(FileUtils.class).to(AndroidFileUtils.class);
|
||||
bind(FileUtils.class).to(FileUtilsImpl.class);
|
||||
bind(LocationUtils.class).to(AndroidLocationUtils.class);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user