Removed println.

This commit is contained in:
akwizgran
2011-10-04 21:45:15 +01:00
parent f02e6b3f89
commit ef811ed295

View File

@@ -6,10 +6,7 @@ import java.io.IOException;
import java.io.OutputStream;
import java.util.Map;
import org.apache.commons.io.FileSystemUtils;
import net.sf.briar.api.ContactId;
import net.sf.briar.api.TransportId;
import net.sf.briar.api.transport.InvalidConfigException;
import net.sf.briar.api.transport.InvalidTransportException;
import net.sf.briar.api.transport.TransportConstants;
@@ -18,25 +15,19 @@ import net.sf.briar.api.transport.batch.BatchTransportPlugin;
import net.sf.briar.api.transport.batch.BatchTransportReader;
import net.sf.briar.api.transport.batch.BatchTransportWriter;
import org.apache.commons.io.FileSystemUtils;
abstract class FilePlugin implements BatchTransportPlugin {
public static final int TRANSPORT_ID = 0;
private static final TransportId id = new TransportId(TRANSPORT_ID);
private boolean started = false;
protected Map<String, String> localProperties = null;
protected Map<ContactId, Map<String, String>> remoteProperties = null;
protected Map<String, String> config = null;
protected BatchTransportCallback callback = null;
private boolean started = false;
protected abstract File chooseOutputDirectory();
protected abstract void writerFinished(File f);
public TransportId getId() {
return id;
}
public synchronized void start(Map<String, String> localProperties,
Map<ContactId, Map<String, String>> remoteProperties,
Map<String, String> config, BatchTransportCallback callback)
@@ -92,9 +83,7 @@ abstract class FilePlugin implements BatchTransportPlugin {
public BatchTransportWriter createWriter(ContactId c) {
if(!started) throw new IllegalStateException();
File dir = chooseOutputDirectory();
if(dir == null) return null;
if(!dir.exists()) return null;
if(!dir.isDirectory()) return null;
if(dir == null || !dir.exists() || !dir.isDirectory()) return null;
File f = new File(dir, createFilename());
try {
long capacity = getCapacity(f.getAbsolutePath());
@@ -111,7 +100,6 @@ abstract class FilePlugin implements BatchTransportPlugin {
StringBuilder s = new StringBuilder(12);
for(int i = 0; i < 8; i++) s.append((char) ('a' + Math.random() * 26));
s.append(".dat");
System.out.println(s);
return s.toString();
}