-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathList.java
More file actions
33 lines (26 loc) · 810 Bytes
/
Copy pathList.java
File metadata and controls
33 lines (26 loc) · 810 Bytes
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
package turing;
import java.nio.channels.SocketChannel;
import java.util.Set;
public class List implements Runnable {
private SocketChannel client;
private Message received;
public List(SocketChannel client, Message received){
this.client = client;
this.received = received;
}
public void run() {
Message toSend = new Message();
try {
Set<Invite> list;
list = Turing.databaseUsers.getDocumentsOfUser(received.getUsername());
if (list.isEmpty())
System.out.println("Server-List ["+ received.getUsername()+"]: nessun documento" );
else System.out.println("Server-List ["+ received.getUsername()+"]: Invio lista..." );
toSend.setMessageList(list);
Message.sendMessage(client, toSend);
client.close();
} catch (Exception e){
e.printStackTrace();
}
}
}