Skip to content

Commit 49f680d

Browse files
committed
Inline variables
1 parent fa6a213 commit 49f680d

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

src/main/java/httpserver/App.java

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,19 @@
99
import java.util.concurrent.Executors;
1010

1111
public class App {
12-
13-
private static ExecutorService threadPool;
14-
private static ServerFactory serverFactory;
15-
private static SocketHandlerFactory socketHandlerFactory;
16-
private static PathExaminer pathExaminer;
17-
private static Path root;
18-
1912
public static void main(String[] args) throws IOException {
2013
int port = Integer.parseInt(args[1]);
2114
String fileDirectory = args[3];
2215

23-
pathExaminer = new PathExaminer();
24-
root = pathExaminer.getPath(fileDirectory);
16+
PathExaminer pathExaminer = new PathExaminer();
17+
Path root = pathExaminer.getPath(fileDirectory);
2518
Path logPath = pathExaminer.concatenate(root,"logs");
2619
AppConfig appConfig = new AppConfig(root, new Logger(logPath, new FileOperator()));
2720

28-
serverFactory = new ServerFactory(new ServerSocketFactory(), appConfig);
29-
socketHandlerFactory = new SocketHandlerFactory();
21+
ServerFactory serverFactory = new ServerFactory(new ServerSocketFactory(), appConfig);
22+
SocketHandlerFactory socketHandlerFactory = new SocketHandlerFactory();
3023

31-
threadPool = Executors.newFixedThreadPool(16);
24+
ExecutorService threadPool = Executors.newFixedThreadPool(16);
3225

3326
Server server = serverFactory.makeServer(port);
3427
while (true) {

0 commit comments

Comments
 (0)