Refactored FileUtils.

Removed methods that are no longer needed for Java 6, moved the remaining method into the utils directory.
This commit is contained in:
akwizgran
2015-12-10 15:58:52 +00:00
parent 947da886bf
commit 912ba394c5
19 changed files with 274 additions and 366 deletions

View File

@@ -1,14 +1,13 @@
package org.briarproject.plugins.file;
import java.util.concurrent.Executor;
import org.briarproject.api.TransportId;
import org.briarproject.api.plugins.simplex.SimplexPlugin;
import org.briarproject.api.plugins.simplex.SimplexPluginCallback;
import org.briarproject.api.plugins.simplex.SimplexPluginFactory;
import org.briarproject.api.system.FileUtils;
import org.briarproject.util.OsUtils;
import java.util.concurrent.Executor;
public class RemovableDrivePluginFactory implements SimplexPluginFactory {
// Maximum latency 14 days (Royal Mail or lackadaisical carrier pigeon)
@@ -16,12 +15,9 @@ public class RemovableDrivePluginFactory implements SimplexPluginFactory {
private static final int POLLING_INTERVAL = 10 * 1000; // 10 seconds
private final Executor ioExecutor;
private final FileUtils fileUtils;
public RemovableDrivePluginFactory(Executor ioExecutor,
FileUtils fileUtils) {
public RemovableDrivePluginFactory(Executor ioExecutor) {
this.ioExecutor = ioExecutor;
this.fileUtils = fileUtils;
}
public TransportId getId() {
@@ -49,7 +45,7 @@ public class RemovableDrivePluginFactory implements SimplexPluginFactory {
} else {
return null;
}
return new RemovableDrivePlugin(ioExecutor, fileUtils, callback,
finder, monitor, MAX_LATENCY);
return new RemovableDrivePlugin(ioExecutor, callback, finder, monitor,
MAX_LATENCY);
}
}