diff --git a/pom.xml b/pom.xml
index 8053350..9d242b2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,170 +4,47 @@
exchange-server
0.1
- 1.8
- 1.8
+ 11
+ 11
UTF-8
- 5.6.0
- 3.0.0-M3
- 3.1.2
- 8.39
- 3.0.0-M5
- 0.8.4
- 3.0.0
-
- 0%
- 0%
- 20
- 5
- org.junit.jupiter
- junit-jupiter-api
- ${junit.version}
- test
+ org.openjfx
+ javafx-controls
+ 17
- org.junit.jupiter
- junit-jupiter-engine
- ${junit.version}
- test
+ org.openjfx
+ javafx-fxml
+ 17
-
- org.apache.maven.plugins
- maven-enforcer-plugin
- ${maven-enforcer-plugin.version}
-
-
-
- enforce
-
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.8.0
-
-
- 3.6.3
-
-
- true
+ 11
-
-
-
-
- org.apache.maven.plugins
- maven-checkstyle-plugin
- ${maven-checkstyle-plugin.version}
-
-
- com.puppycrawl.tools
- checkstyle
- ${checkstyle.version}
-
-
- com.github.ngeor
- checkstyle-rules
- 4.8.0
-
-
-
- com/github/ngeor/checkstyle.xml
- true
- ${skipTests}
-
-
-
- checkstyle
- validate
-
- check
-
-
-
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
- ${maven-surefire-plugin.version}
-
-
- org.jacoco
- jacoco-maven-plugin
- ${jacoco-maven-plugin.version}
-
-
- pre-unit-test
-
- prepare-agent
-
-
-
- post-unit-test
- test
-
- report
-
-
-
- check-unit-test
- test
-
- check
-
-
- ${project.build.directory}/jacoco.exec
-
-
- BUNDLE
-
-
- INSTRUCTION
- COVEREDRATIO
- ${jacoco.unit-tests.limit.instruction-ratio}
-
-
- BRANCH
- COVEREDRATIO
- ${jacoco.unit-tests.limit.branch-ratio}
-
-
-
-
- CLASS
-
-
- COMPLEXITY
- TOTALCOUNT
- ${jacoco.unit-tests.limit.class-complexity}
-
-
-
-
- METHOD
-
-
- COMPLEXITY
- TOTALCOUNT
- ${jacoco.unit-tests.limit.method-complexity}
-
-
-
-
-
-
-
-
+
+
+ org.openjfx
+ javafx-maven-plugin
+ 0.0.6
+
+
+
+
+ default-cli
+
+ ru.molokoin.App
+
+
+
+
-
-
-
- org.apache.maven.plugins
- maven-javadoc-plugin
- ${maven-javadoc-plugin.version}
-
-
-
diff --git a/src/main/java/module-info.java b/src/main/java/module-info.java
new file mode 100644
index 0000000..67791b1
--- /dev/null
+++ b/src/main/java/module-info.java
@@ -0,0 +1,5 @@
+module ru.molokoin {
+ requires javafx.controls;
+ requires javafx.fxml;
+ exports ru.molokoin;
+}
diff --git a/src/main/java/ru/molokoin/App.java b/src/main/java/ru/molokoin/App.java
new file mode 100644
index 0000000..d89a224
--- /dev/null
+++ b/src/main/java/ru/molokoin/App.java
@@ -0,0 +1,37 @@
+package ru.molokoin;
+
+import java.net.URL;
+
+import javafx.application.Application;
+import javafx.fxml.FXMLLoader;
+//import javafx.fxml.*;
+import javafx.scene.Parent;
+import javafx.scene.Scene;
+import javafx.stage.Stage;
+
+
+/**
+ * JavaFX App
+ */
+public class App extends Application {
+
+ @Override
+ public void start(Stage stage){
+ try {
+ String link = "/face/mainframe.fxml";
+ Parent root = FXMLLoader.load(getClass().getResource(link));
+ stage.setTitle("exchange-server-settings");
+ stage.setScene(new Scene(root));
+ stage.show();
+ } catch (Exception e) {
+ System.out.println("Не удалось запустить сцену. Ошибка: " + e);
+ }
+
+
+ }
+
+ public static void main(String[] args) {
+ launch();
+ }
+
+}
\ No newline at end of file
diff --git a/src/main/java/ru/molokoin/ExchangeServer.java b/src/main/java/ru/molokoin/ExchangeServer.java
index 7c48459..1a8c505 100644
--- a/src/main/java/ru/molokoin/ExchangeServer.java
+++ b/src/main/java/ru/molokoin/ExchangeServer.java
@@ -14,8 +14,26 @@ public class ExchangeServer{
private static int port = 8081;
private static String link = "localhost";
private static int num = 0;
+ ServerSocket serverSocket;
+ Socket socket;
- public static void main(String[] args) {
+
+ //подготовка компонентов
+ public void init(){
+
+ }
+
+ //остановка серера
+ public void stop(){
+ try {
+ serverSocket.close();
+ //socket.close();
+ } catch (Exception e) {
+ System.out.println("Остановить сервер не удалось. Ошибка: " + e);
+ }
+ }
+ //запуск сервера
+ public void start(){
try (ServerSocket serverSocket = new ServerSocket(port)) {
System.out.println("Server started at port: " + port + " ...");
@@ -44,16 +62,19 @@ public class ExchangeServer{
if(firstLine.startsWith("GET")){
querry = "GET";
}
+ if(firstLine.startsWith("POST")){
+ querry = "POST";
+ }
System.out.println("firstLine: " + firstLine);
System.out.println("querry: " + querry);
}
- System.out.println(line);
+ //System.out.println(line);
}
// отправляем ответ
System.out.println("отправка ответа от сервера:");
String path = new File("").getAbsolutePath();
- String fileName = "upload.html";
+ String fileName = "upload.http";
path = path + "/src/main/webapp/";
File file = new File(path + fileName);
//String text = "";
@@ -81,4 +102,9 @@ public class ExchangeServer{
ex.printStackTrace();
}
}
+
+ public static void main(String[] args) {
+ new ExchangeServer().start();
+ }
+
}
diff --git a/src/main/java/ru/molokoin/MainFrameController.java b/src/main/java/ru/molokoin/MainFrameController.java
new file mode 100644
index 0000000..da2adca
--- /dev/null
+++ b/src/main/java/ru/molokoin/MainFrameController.java
@@ -0,0 +1,37 @@
+package ru.molokoin;
+
+import java.net.URL;
+import java.util.ResourceBundle;
+
+import javafx.event.Event;
+import javafx.fxml.FXML;
+import javafx.fxml.Initializable;
+import javafx.scene.control.Button;
+import javafx.scene.input.MouseEvent;
+
+public class MainFrameController implements Initializable{
+ @FXML
+ public Button btn;
+ public ExchangeServer server;
+
+ @Override
+ public void initialize(URL location, ResourceBundle resources) {
+ // TODO Auto-generated method stub
+ System.out.println("Инициализация компонентов интерфейса ...");
+ server = new ExchangeServer();
+ }
+
+ @FXML
+ public void buttonClicked(Event e){
+ System.out.println("Button clicked");
+ if (btn.getText().equals("START")){
+ btn.setText("STOP");
+ server.start();
+
+ }else {
+ btn.setText("START");
+ server.stop();
+ }
+
+ }
+}
diff --git a/src/main/java/ru/molokoin/SystemInfo.java b/src/main/java/ru/molokoin/SystemInfo.java
new file mode 100644
index 0000000..9def5ed
--- /dev/null
+++ b/src/main/java/ru/molokoin/SystemInfo.java
@@ -0,0 +1,13 @@
+package ru.molokoin;
+
+public class SystemInfo {
+
+ public static String javaVersion() {
+ return System.getProperty("java.version");
+ }
+
+ public static String javafxVersion() {
+ return System.getProperty("javafx.version");
+ }
+
+}
\ No newline at end of file
diff --git a/src/main/resources/face/mainframe.fxml b/src/main/resources/face/mainframe.fxml
new file mode 100644
index 0000000..3ac0079
--- /dev/null
+++ b/src/main/resources/face/mainframe.fxml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/webapp/upload.html b/src/main/webapp/upload.http
similarity index 100%
rename from src/main/webapp/upload.html
rename to src/main/webapp/upload.http
diff --git a/src/test/java/ru/molokoin/AppTest.java b/src/test/java/ru/molokoin/AppTest.java
deleted file mode 100644
index 5d9a122..0000000
--- a/src/test/java/ru/molokoin/AppTest.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package ru.molokoin;
-
-import org.junit.jupiter.api.Test;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-
-/**
- * Unit test for simple App.
- */
-class AppTest {
- /**
- * Rigorous Test.
- */
- @Test
- void testApp() {
- assertEquals(1, 1);
- }
-}
diff --git a/target/classes/face/mainframe.fxml b/target/classes/face/mainframe.fxml
new file mode 100644
index 0000000..3ac0079
--- /dev/null
+++ b/target/classes/face/mainframe.fxml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/target/classes/module-info.class b/target/classes/module-info.class
new file mode 100644
index 0000000..c29a429
Binary files /dev/null and b/target/classes/module-info.class differ
diff --git a/target/classes/ru/molokoin/App.class b/target/classes/ru/molokoin/App.class
new file mode 100644
index 0000000..7cc3088
Binary files /dev/null and b/target/classes/ru/molokoin/App.class differ
diff --git a/target/classes/ru/molokoin/ExchangeServer.class b/target/classes/ru/molokoin/ExchangeServer.class
index d9817e2..f1b35b0 100644
Binary files a/target/classes/ru/molokoin/ExchangeServer.class and b/target/classes/ru/molokoin/ExchangeServer.class differ
diff --git a/target/classes/ru/molokoin/MainFrameController.class b/target/classes/ru/molokoin/MainFrameController.class
new file mode 100644
index 0000000..de5e021
Binary files /dev/null and b/target/classes/ru/molokoin/MainFrameController.class differ
diff --git a/target/classes/ru/molokoin/SystemInfo.class b/target/classes/ru/molokoin/SystemInfo.class
new file mode 100644
index 0000000..f64b165
Binary files /dev/null and b/target/classes/ru/molokoin/SystemInfo.class differ
diff --git a/target/classes/ru/molokoin/UploadServer.class b/target/classes/ru/molokoin/UploadServer.class
index 551f547..7b45696 100644
Binary files a/target/classes/ru/molokoin/UploadServer.class and b/target/classes/ru/molokoin/UploadServer.class differ
diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
new file mode 100644
index 0000000..e69de29
diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
new file mode 100644
index 0000000..4b4fa0b
--- /dev/null
+++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
@@ -0,0 +1,5 @@
+c:\Users\Strannik\Documents\esoe\code\exchange-server\src\main\java\ru\molokoin\SystemInfo.java
+c:\Users\Strannik\Documents\esoe\code\exchange-server\src\main\java\module-info.java
+c:\Users\Strannik\Documents\esoe\code\exchange-server\src\main\java\ru\molokoin\ExchangeServer.java
+c:\Users\Strannik\Documents\esoe\code\exchange-server\src\main\java\ru\molokoin\App.java
+c:\Users\Strannik\Documents\esoe\code\exchange-server\src\main\java\ru\molokoin\UploadServer.java
diff --git a/target/test-classes/ru/molokoin/AppTest.class b/target/test-classes/ru/molokoin/AppTest.class
index c70cc8f..c843752 100644
Binary files a/target/test-classes/ru/molokoin/AppTest.class and b/target/test-classes/ru/molokoin/AppTest.class differ