Project setup
This commit is contained in:
7
src/main/java/acq/Main.java
Normal file
7
src/main/java/acq/Main.java
Normal file
@@ -0,0 +1,7 @@
|
||||
package acq;
|
||||
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
|
||||
}
|
||||
}
|
||||
7
src/main/java/acs/Main.java
Normal file
7
src/main/java/acs/Main.java
Normal file
@@ -0,0 +1,7 @@
|
||||
package acs;
|
||||
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
|
||||
}
|
||||
}
|
||||
21
src/main/java/common/Logger.java
Normal file
21
src/main/java/common/Logger.java
Normal file
@@ -0,0 +1,21 @@
|
||||
package common;
|
||||
|
||||
public class Logger {
|
||||
public static void displayInfo(String message){
|
||||
final String BLUE = "\u001B[34m";
|
||||
final String RESET = "\u001B[0m";
|
||||
System.out.println(BLUE + "Info >>> " + message + RESET);
|
||||
}
|
||||
|
||||
public static void displayReceived(String message){
|
||||
String GREEN = "\u001B[32m";
|
||||
String RESET = "\u001B[0m";
|
||||
System.out.println(GREEN + "Received >>> " + message + RESET);
|
||||
}
|
||||
|
||||
public static void displaySent(String message){
|
||||
final String RED = "\u001B[31m";
|
||||
final String RESET = "\u001B[0m";
|
||||
System.out.println(RED + "Sent >>> " + message + RESET);
|
||||
}
|
||||
}
|
||||
19
src/main/java/common/SocketManager.java
Normal file
19
src/main/java/common/SocketManager.java
Normal file
@@ -0,0 +1,19 @@
|
||||
package common;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.net.Socket;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
public class SocketManager {
|
||||
public static void send(Socket socket, String data) throws IOException {
|
||||
OutputStream output = socket.getOutputStream();
|
||||
output.write(String.format("%s\r\n", data).getBytes(StandardCharsets.UTF_8));
|
||||
output.flush();
|
||||
}
|
||||
|
||||
public static String readResponse(BufferedReader reader) throws IOException {
|
||||
return reader.readLine();
|
||||
}
|
||||
}
|
||||
9
src/main/java/externalApp/Main.java
Normal file
9
src/main/java/externalApp/Main.java
Normal file
@@ -0,0 +1,9 @@
|
||||
package externalApp;
|
||||
|
||||
import common.Logger;
|
||||
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
|
||||
}
|
||||
}
|
||||
7
src/main/java/httpsServer/Main.java
Normal file
7
src/main/java/httpsServer/Main.java
Normal file
@@ -0,0 +1,7 @@
|
||||
package httpsServer;
|
||||
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
System.out.println("Hello World!");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user