Fix last commit

This commit is contained in:
Louis Royer 2020-01-21 19:56:50 +01:00
parent b3cc441d9e
commit f4e318dfe5
3 changed files with 6 additions and 6 deletions

View File

@ -6,9 +6,9 @@ import tools.Directories;
public class ClientP2P {
private String host;
private int port;
private String dataHomeDirectory;
private Directories directories;
public ClientP2P() {
Directories directories = new Directories("P2P_JAVA_PROJECT_CLIENT");
directories = new Directories("P2P_JAVA_PROJECT_CLIENT");
host = "localhost";
port = 40000;
System.out.println("Client will try to contact server at " + host + " on port " + port + ". It will save files in " + directories.getDataHomeDirectory());

View File

@ -4,12 +4,11 @@ import tools.Directories;
public class ServerP2P {
private int port;
private String dataHomeDirectory;
public ServerP2P() {
Directories directories = new Directories("P2P_JAVA_PROJECT_SERVER");
private Directories directories;
public ServerP2P() {
directories = new Directories("P2P_JAVA_PROJECT_SERVER");
port = 40000;
dataHomeDirectory = d.getDataHomeDirectory();
System.out.println("Server will listen on port " + port + " and serve files from " + directories.getDataHomeDirectory());
directories.askOpenDataHomeDirectory();
}

View File

@ -83,6 +83,7 @@ public class Directories {
openDataHomeDirectory();
}
}
}
}