@@ -14,16 +14,19 @@ public class App {
1414 private static ServerFactory serverFactory ;
1515 private static SocketHandlerFactory socketHandlerFactory ;
1616 private static PathExaminer pathExaminer ;
17+ private static Path root ;
1718
1819 public static void main (String [] args ) throws IOException {
1920 int port = Integer .parseInt (args [1 ]);
2021 String fileDirectory = args [3 ];
2122
2223 pathExaminer = new PathExaminer ();
23- Path root = pathExaminer .getPath (fileDirectory );
24+ root = pathExaminer .getPath (fileDirectory );
2425 Path logPath = pathExaminer .concatenate (root ,"logs" );
2526 AppConfig appConfig = new AppConfig (root , new Logger (logPath , new FileOperator ()));
2627
28+ createFormFile ();
29+
2730 serverFactory = new ServerFactory (new ServerSocketFactory (), appConfig );
2831 socketHandlerFactory = new SocketHandlerFactory ();
2932
@@ -34,4 +37,12 @@ public static void main(String[] args) throws IOException {
3437 server .acceptConnection (threadPool , socketHandlerFactory );
3538 }
3639 }
40+
41+ private static void createFormFile () {
42+ Path formRoot = pathExaminer .getFullPath (root , "/form" );
43+ try {
44+ new FileOperator ().createFileAtPath (formRoot );
45+ } catch (IOException e ) {
46+ }
47+ }
3748}
0 commit comments