Skip to content

Commit

Permalink
Merge branch 'main' into Add-Teapot
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/main/java/org/fungover/storm/client/ClientHandler.java
  • Loading branch information
kappsegla committed Feb 14, 2024
2 parents 3642d34 + 292ece9 commit d2a2b96
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 22 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/code_quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ jobs:
qodana:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: 'Qodana Scan'
uses: JetBrains/qodana-action@v2022.3.4
uses: JetBrains/qodana-action@v2023.3.1
with:
linter: jetbrains/qodana-jvm
fail-threshold: 1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
# add: '*.svg'
- name: Upload JaCoCo coverage report
if: ${{ github.event_name == 'push' }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: jacoco-report
path: target/site/jacoco/
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Log in to the Container registry
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
Expand All @@ -39,7 +39,7 @@ jobs:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56
with:
context: .
push: true
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM maven:3.9.6-openjdk-21-slim as build
FROM maven:3.9.6-eclipse-temurin-21 as build
COPY ./ /src
RUN mvn -f /src/pom.xml clean package

Expand All @@ -7,4 +7,5 @@ COPY --from=build /src/target/modules /app/modules
COPY --from=build /src/target/storm.jar /app/storm.jar
COPY --from=build /src/webroot /webroot
COPY --from=build /src/config/config.json /etc/storm/config/config.json
EXPOSE 8080
ENTRYPOINT ["java","--module-path","app/storm.jar:app/modules","-m","org.fungover.storm/org.fungover.storm.server.Server"]
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.6.0</version>
<version>3.6.1</version>
<executions>
<execution>
<id>copy</id>
Expand Down
7 changes: 3 additions & 4 deletions src/main/java/org/fungover/storm/client/ClientHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import org.fungover.storm.filehandler.re.FileInfo;
import org.fungover.storm.filehandler.re.FileNotFoundException;
import org.fungover.storm.filehandler.re.FileRequestHandler;
import org.fungover.storm.filehandler.re.ResponseCode;
import org.fungover.storm.filehandler.re.Teapot;

import java.io.BufferedReader;
Expand All @@ -17,8 +18,7 @@
public class ClientHandler implements Runnable {
private static final Logger LOGGER = LogManager.getLogger("CLIENT_HANDLER");
private final Socket clientSocket;
private HttpResponseStatusCodes statusCode;
private FileRequestHandler fileRequestHandler;
private final FileRequestHandler fileRequestHandler;

public ClientHandler(Socket socket, FileRequestHandler fileRequestHandler) {
this.clientSocket = socket;
Expand Down Expand Up @@ -52,9 +52,8 @@ public void run() {
out.close();
clientSocket.close();
} catch (IOException e) {
statusCode = new HttpResponseStatusCodes();
if (e.getMessage().contains("500"))
LOGGER.error(statusCode.getError500());
LOGGER.error(ResponseCode.HTTP_RESPONSE_STATUS_CODES);
else
LOGGER.error(e.getMessage());
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ public enum ResponseCode {
FORBIDDEN("403 Forbidden"),
TEAPOT("418 I´m a teapot"),
INTERNAL_SERVER_ERROR("500 Internal Server Error"),
HTTP_RESPONSE_STATUS_CODES("500 Internal Server Error\r\n"),
NOT_IMPLEMENTED("501 Not Implemented");


private final String code;

ResponseCode(String code) {
Expand Down

0 comments on commit d2a2b96

Please sign in to comment.