From f4e318dfe5ad021b2df005cb2c049122f9b888f5 Mon Sep 17 00:00:00 2001 From: Louis Date: Tue, 21 Jan 2020 19:56:50 +0100 Subject: [PATCH] Fix last commit --- src/clientP2P/ClientP2P.java | 4 ++-- src/serverP2P/ServerP2P.java | 7 +++---- src/tools/Directories.java | 1 + 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/clientP2P/ClientP2P.java b/src/clientP2P/ClientP2P.java index 1d09a0c..32c2641 100644 --- a/src/clientP2P/ClientP2P.java +++ b/src/clientP2P/ClientP2P.java @@ -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()); diff --git a/src/serverP2P/ServerP2P.java b/src/serverP2P/ServerP2P.java index c681d66..00be061 100644 --- a/src/serverP2P/ServerP2P.java +++ b/src/serverP2P/ServerP2P.java @@ -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(); } diff --git a/src/tools/Directories.java b/src/tools/Directories.java index 92a18b7..da6363f 100644 --- a/src/tools/Directories.java +++ b/src/tools/Directories.java @@ -83,6 +83,7 @@ public class Directories { openDataHomeDirectory(); } } + } }