blob: 446b982e9794a0453e34b7d55884323e6347046f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
package fileserv;
import java.io.IOException;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.openslx.filetransfer.Downloader;
import org.openslx.filetransfer.IncomingEvent;
import org.openslx.filetransfer.Listener;
import org.openslx.filetransfer.Uploader;
public class FileServer implements IncomingEvent {
/**
* Listener for incoming unencrypted connections
*/
private Listener plainListener = new Listener(this, null, 9092); // TODO: Config
/**
* All currently running uploads, indexed by token
*/
private Map<String, ActiveUpload> uploads = new ConcurrentHashMap<>();
public boolean start() {
boolean ret = plainListener.start();
// TODO: Start SSL listener too
return ret;
}
@Override
public void incomingDownloadRequest(Uploader uploader) throws IOException {
// TODO Auto-generated method stub
}
@Override
public void incomingUploadRequest(Downloader downloader) throws IOException {
// TODO Auto-generated method stub
}
}
|