diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index e1f2e3b..e2285a4 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -27,7 +27,6 @@ "github.vscode-github-actions", "GitHub.vscode-pull-request-github", "redhat.vscode-yaml", - "vscjava.vscode-maven", "redhat.vscode-xml" ], "settings": { diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml deleted file mode 100644 index 309790f..0000000 --- a/.github/workflows/maven-publish.yml +++ /dev/null @@ -1,44 +0,0 @@ -# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created -# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path - -name: Maven Package - -on: - release: - types: [created] - -jobs: - build: - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - - steps: - - uses: actions/checkout@v4 - - name: Set up JDK 21 - uses: actions/setup-java@v4 - with: - java-version: '21' - distribution: 'corretto' - server-id: github # Value of the distributionManagement/repository/id field of the pom.xml - settings-path: ${{ github.workspace }} # location for the settings.xml file - - - name: Build with Maven - run: mvn -B package --file pom.xml - - - name: Set up Maven settings - run: | - mkdir -p ~/.m2 - echo " - - - github - ${{ github.actor }} - ${{ secrets.ACCESS_TOKEN }} - - - " > ~/.m2/settings.xml - - - name: Publish to GitHub Packages Apache Maven - run: mvn deploy \ No newline at end of file diff --git a/build/MANIFEST.MF b/build/MANIFEST.MF new file mode 100644 index 0000000..a6c8fc8 --- /dev/null +++ b/build/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Main-Class: com.kerosenelabs.kindling.Main +Created-By: Espresso \ No newline at end of file diff --git a/build/com/kerosenelabs/kindling/HttpRequest.class b/build/com/kerosenelabs/kindling/HttpRequest.class new file mode 100644 index 0000000..d0f1cc8 Binary files /dev/null and b/build/com/kerosenelabs/kindling/HttpRequest.class differ diff --git a/build/com/kerosenelabs/kindling/HttpResponse$Builder.class b/build/com/kerosenelabs/kindling/HttpResponse$Builder.class new file mode 100644 index 0000000..83d49a2 Binary files /dev/null and b/build/com/kerosenelabs/kindling/HttpResponse$Builder.class differ diff --git a/build/com/kerosenelabs/kindling/HttpResponse.class b/build/com/kerosenelabs/kindling/HttpResponse.class new file mode 100644 index 0000000..c141f10 Binary files /dev/null and b/build/com/kerosenelabs/kindling/HttpResponse.class differ diff --git a/build/com/kerosenelabs/kindling/KindlingServer$1.class b/build/com/kerosenelabs/kindling/KindlingServer$1.class new file mode 100644 index 0000000..8d00001 Binary files /dev/null and b/build/com/kerosenelabs/kindling/KindlingServer$1.class differ diff --git a/build/com/kerosenelabs/kindling/KindlingServer.class b/build/com/kerosenelabs/kindling/KindlingServer.class new file mode 100644 index 0000000..e8806b9 Binary files /dev/null and b/build/com/kerosenelabs/kindling/KindlingServer.class differ diff --git a/build/com/kerosenelabs/kindling/Main$1$1.class b/build/com/kerosenelabs/kindling/Main$1$1.class new file mode 100644 index 0000000..86d31fe Binary files /dev/null and b/build/com/kerosenelabs/kindling/Main$1$1.class differ diff --git a/build/com/kerosenelabs/kindling/Main$1.class b/build/com/kerosenelabs/kindling/Main$1.class new file mode 100644 index 0000000..abf1d83 Binary files /dev/null and b/build/com/kerosenelabs/kindling/Main$1.class differ diff --git a/build/com/kerosenelabs/kindling/Main.class b/build/com/kerosenelabs/kindling/Main.class new file mode 100644 index 0000000..a48c1c7 Binary files /dev/null and b/build/com/kerosenelabs/kindling/Main.class differ diff --git a/build/com/kerosenelabs/kindling/WorkerThreadNameGenerator.class b/build/com/kerosenelabs/kindling/WorkerThreadNameGenerator.class new file mode 100644 index 0000000..a3dbc57 Binary files /dev/null and b/build/com/kerosenelabs/kindling/WorkerThreadNameGenerator.class differ diff --git a/build/com/kerosenelabs/kindling/constant/HttpMethod.class b/build/com/kerosenelabs/kindling/constant/HttpMethod.class new file mode 100644 index 0000000..30f7e74 Binary files /dev/null and b/build/com/kerosenelabs/kindling/constant/HttpMethod.class differ diff --git a/build/com/kerosenelabs/kindling/constant/HttpStatus.class b/build/com/kerosenelabs/kindling/constant/HttpStatus.class new file mode 100644 index 0000000..fbe404c Binary files /dev/null and b/build/com/kerosenelabs/kindling/constant/HttpStatus.class differ diff --git a/build/com/kerosenelabs/kindling/constant/MimeType.class b/build/com/kerosenelabs/kindling/constant/MimeType.class new file mode 100644 index 0000000..e0cfa86 Binary files /dev/null and b/build/com/kerosenelabs/kindling/constant/MimeType.class differ diff --git a/build/com/kerosenelabs/kindling/dto/HttpRequestHead.class b/build/com/kerosenelabs/kindling/dto/HttpRequestHead.class new file mode 100644 index 0000000..ee6034a Binary files /dev/null and b/build/com/kerosenelabs/kindling/dto/HttpRequestHead.class differ diff --git a/build/com/kerosenelabs/kindling/exception/KindlingException.class b/build/com/kerosenelabs/kindling/exception/KindlingException.class new file mode 100644 index 0000000..9d2138b Binary files /dev/null and b/build/com/kerosenelabs/kindling/exception/KindlingException.class differ diff --git a/build/com/kerosenelabs/kindling/handler/RequestHandler.class b/build/com/kerosenelabs/kindling/handler/RequestHandler.class new file mode 100644 index 0000000..dd7bd55 Binary files /dev/null and b/build/com/kerosenelabs/kindling/handler/RequestHandler.class differ diff --git a/build/io/kerosenelabs/kindling/HttpRequest.class b/build/io/kerosenelabs/kindling/HttpRequest.class new file mode 100644 index 0000000..e7c11c7 Binary files /dev/null and b/build/io/kerosenelabs/kindling/HttpRequest.class differ diff --git a/build/io/kerosenelabs/kindling/HttpResponse$Builder.class b/build/io/kerosenelabs/kindling/HttpResponse$Builder.class new file mode 100644 index 0000000..8191856 Binary files /dev/null and b/build/io/kerosenelabs/kindling/HttpResponse$Builder.class differ diff --git a/build/io/kerosenelabs/kindling/HttpResponse.class b/build/io/kerosenelabs/kindling/HttpResponse.class new file mode 100644 index 0000000..7044c3a Binary files /dev/null and b/build/io/kerosenelabs/kindling/HttpResponse.class differ diff --git a/build/io/kerosenelabs/kindling/KindlingServer$1.class b/build/io/kerosenelabs/kindling/KindlingServer$1.class new file mode 100644 index 0000000..58c5063 Binary files /dev/null and b/build/io/kerosenelabs/kindling/KindlingServer$1.class differ diff --git a/build/io/kerosenelabs/kindling/KindlingServer.class b/build/io/kerosenelabs/kindling/KindlingServer.class new file mode 100644 index 0000000..0851665 Binary files /dev/null and b/build/io/kerosenelabs/kindling/KindlingServer.class differ diff --git a/build/io/kerosenelabs/kindling/Main$1$1.class b/build/io/kerosenelabs/kindling/Main$1$1.class new file mode 100644 index 0000000..fa33159 Binary files /dev/null and b/build/io/kerosenelabs/kindling/Main$1$1.class differ diff --git a/build/io/kerosenelabs/kindling/Main$1.class b/build/io/kerosenelabs/kindling/Main$1.class new file mode 100644 index 0000000..f6eedeb Binary files /dev/null and b/build/io/kerosenelabs/kindling/Main$1.class differ diff --git a/build/io/kerosenelabs/kindling/Main.class b/build/io/kerosenelabs/kindling/Main.class new file mode 100644 index 0000000..42bab71 Binary files /dev/null and b/build/io/kerosenelabs/kindling/Main.class differ diff --git a/build/io/kerosenelabs/kindling/WorkerThreadNameGenerator.class b/build/io/kerosenelabs/kindling/WorkerThreadNameGenerator.class new file mode 100644 index 0000000..10587bf Binary files /dev/null and b/build/io/kerosenelabs/kindling/WorkerThreadNameGenerator.class differ diff --git a/build/io/kerosenelabs/kindling/constant/HttpMethod.class b/build/io/kerosenelabs/kindling/constant/HttpMethod.class new file mode 100644 index 0000000..7a3dd9b Binary files /dev/null and b/build/io/kerosenelabs/kindling/constant/HttpMethod.class differ diff --git a/build/io/kerosenelabs/kindling/constant/HttpStatus.class b/build/io/kerosenelabs/kindling/constant/HttpStatus.class new file mode 100644 index 0000000..2f12ac1 Binary files /dev/null and b/build/io/kerosenelabs/kindling/constant/HttpStatus.class differ diff --git a/build/io/kerosenelabs/kindling/constant/MimeType.class b/build/io/kerosenelabs/kindling/constant/MimeType.class new file mode 100644 index 0000000..6eaf1f4 Binary files /dev/null and b/build/io/kerosenelabs/kindling/constant/MimeType.class differ diff --git a/build/io/kerosenelabs/kindling/dto/HttpRequestHead.class b/build/io/kerosenelabs/kindling/dto/HttpRequestHead.class new file mode 100644 index 0000000..7feb028 Binary files /dev/null and b/build/io/kerosenelabs/kindling/dto/HttpRequestHead.class differ diff --git a/build/io/kerosenelabs/kindling/exception/KindlingException.class b/build/io/kerosenelabs/kindling/exception/KindlingException.class new file mode 100644 index 0000000..8dc55d4 Binary files /dev/null and b/build/io/kerosenelabs/kindling/exception/KindlingException.class differ diff --git a/build/io/kerosenelabs/kindling/handler/RequestHandler.class b/build/io/kerosenelabs/kindling/handler/RequestHandler.class new file mode 100644 index 0000000..907ea6e Binary files /dev/null and b/build/io/kerosenelabs/kindling/handler/RequestHandler.class differ diff --git a/dist/dist.jar b/dist/dist.jar new file mode 100644 index 0000000..045c522 Binary files /dev/null and b/dist/dist.jar differ diff --git a/espresso b/espresso new file mode 100755 index 0000000..d5fb670 Binary files /dev/null and b/espresso differ diff --git a/espresso.yml b/espresso.yml new file mode 100644 index 0000000..0ae666c --- /dev/null +++ b/espresso.yml @@ -0,0 +1,13 @@ +name: Kindling +version: + major: 0 + minor: 2 + patch: 0 + hotfix: null +basePackage: com.kerosenelabs.kindling +toolchain: + path: /usr/lib/jvm/msopenjdk-current +dependencies: [] +registries: + - name: espresso-registry + url: https://github.com/Kerosene-Labs/espresso-registry/archive/refs/heads/main.zip diff --git a/pom.xml b/pom.xml deleted file mode 100644 index 59c15e6..0000000 --- a/pom.xml +++ /dev/null @@ -1,54 +0,0 @@ - - 4.0.0 - io.kerosenelabs - kindling - jar - 0.1.3 - kindling - http://maven.apache.org - - - - org.junit.jupiter - junit-jupiter-api - 5.10.3 - test - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.13.0 - - 21 - 21 - - - - org.apache.maven.plugins - maven-jar-plugin - 3.4.2 - - - - true - lib/ - io.kerosenelabs.kindling.Main - - - - - - - - - github - GitHub Kerosene-Labs Apache Maven Packages - https://maven.pkg.github.com/Kerosene-Labs/kindling - - - \ No newline at end of file diff --git a/src/main/java/io/kerosenelabs/kindling/HttpRequest.java b/src/java/com/kerosenelabs/kindling/HttpRequest.java similarity index 95% rename from src/main/java/io/kerosenelabs/kindling/HttpRequest.java rename to src/java/com/kerosenelabs/kindling/HttpRequest.java index a2b9c6f..5724668 100644 --- a/src/main/java/io/kerosenelabs/kindling/HttpRequest.java +++ b/src/java/com/kerosenelabs/kindling/HttpRequest.java @@ -1,4 +1,4 @@ -package io.kerosenelabs.kindling; +package com.kerosenelabs.kindling; import java.io.BufferedReader; import java.io.IOException; @@ -7,10 +7,10 @@ import java.util.List; import java.util.Map.Entry; -import io.kerosenelabs.kindling.constant.HttpMethod; -import io.kerosenelabs.kindling.dto.HttpRequestHead; -import io.kerosenelabs.kindling.exception.KindlingException; -import io.kerosenelabs.kindling.handler.RequestHandler; +import com.kerosenelabs.kindling.constant.HttpMethod; +import com.kerosenelabs.kindling.dto.HttpRequestHead; +import com.kerosenelabs.kindling.exception.KindlingException; +import com.kerosenelabs.kindling.handler.RequestHandler; /** * A generic implementation of {@link RequestHandler}. diff --git a/src/main/java/io/kerosenelabs/kindling/HttpResponse.java b/src/java/com/kerosenelabs/kindling/HttpResponse.java similarity index 95% rename from src/main/java/io/kerosenelabs/kindling/HttpResponse.java rename to src/java/com/kerosenelabs/kindling/HttpResponse.java index 10e6eaf..3ddd223 100644 --- a/src/main/java/io/kerosenelabs/kindling/HttpResponse.java +++ b/src/java/com/kerosenelabs/kindling/HttpResponse.java @@ -1,8 +1,8 @@ -package io.kerosenelabs.kindling; +package com.kerosenelabs.kindling; import java.util.HashMap; -import io.kerosenelabs.kindling.constant.HttpStatus; +import com.kerosenelabs.kindling.constant.HttpStatus; public class HttpResponse { private HttpStatus httpStatus; diff --git a/src/main/java/io/kerosenelabs/kindling/KindlingServer.java b/src/java/com/kerosenelabs/kindling/KindlingServer.java similarity index 96% rename from src/main/java/io/kerosenelabs/kindling/KindlingServer.java rename to src/java/com/kerosenelabs/kindling/KindlingServer.java index cc33224..a28bd87 100644 --- a/src/main/java/io/kerosenelabs/kindling/KindlingServer.java +++ b/src/java/com/kerosenelabs/kindling/KindlingServer.java @@ -1,4 +1,4 @@ -package io.kerosenelabs.kindling; +package com.kerosenelabs.kindling; import java.io.BufferedReader; import java.io.IOException; @@ -16,9 +16,9 @@ import javax.net.ssl.SSLServerSocketFactory; import javax.net.ssl.SSLSocket; -import io.kerosenelabs.kindling.constant.HttpStatus; -import io.kerosenelabs.kindling.exception.KindlingException; -import io.kerosenelabs.kindling.handler.RequestHandler; +import com.kerosenelabs.kindling.constant.HttpStatus; +import com.kerosenelabs.kindling.exception.KindlingException; +import com.kerosenelabs.kindling.handler.RequestHandler; /** * The HTTPS Server singleton diff --git a/src/main/java/io/kerosenelabs/kindling/Main.java b/src/java/com/kerosenelabs/kindling/Main.java similarity index 83% rename from src/main/java/io/kerosenelabs/kindling/Main.java rename to src/java/com/kerosenelabs/kindling/Main.java index d9a3413..80375c8 100644 --- a/src/main/java/io/kerosenelabs/kindling/Main.java +++ b/src/java/com/kerosenelabs/kindling/Main.java @@ -1,12 +1,12 @@ -package io.kerosenelabs.kindling; +package com.kerosenelabs.kindling; import java.nio.file.Path; import java.util.HashMap; -import io.kerosenelabs.kindling.constant.HttpMethod; -import io.kerosenelabs.kindling.constant.HttpStatus; -import io.kerosenelabs.kindling.exception.KindlingException; -import io.kerosenelabs.kindling.handler.RequestHandler; +import com.kerosenelabs.kindling.constant.HttpMethod; +import com.kerosenelabs.kindling.constant.HttpStatus; +import com.kerosenelabs.kindling.exception.KindlingException; +import com.kerosenelabs.kindling.handler.RequestHandler; public class Main { public static void main(String[] args) throws KindlingException { diff --git a/src/main/java/io/kerosenelabs/kindling/WorkerThreadNameGenerator.java b/src/java/com/kerosenelabs/kindling/WorkerThreadNameGenerator.java similarity index 69% rename from src/main/java/io/kerosenelabs/kindling/WorkerThreadNameGenerator.java rename to src/java/com/kerosenelabs/kindling/WorkerThreadNameGenerator.java index d302153..5f3113a 100644 --- a/src/main/java/io/kerosenelabs/kindling/WorkerThreadNameGenerator.java +++ b/src/java/com/kerosenelabs/kindling/WorkerThreadNameGenerator.java @@ -1,4 +1,4 @@ -package io.kerosenelabs.kindling; +package com.kerosenelabs.kindling; public interface WorkerThreadNameGenerator { public String generate(); diff --git a/src/main/java/io/kerosenelabs/kindling/constant/HttpMethod.java b/src/java/com/kerosenelabs/kindling/constant/HttpMethod.java similarity index 60% rename from src/main/java/io/kerosenelabs/kindling/constant/HttpMethod.java rename to src/java/com/kerosenelabs/kindling/constant/HttpMethod.java index f4b317a..45ad960 100644 --- a/src/main/java/io/kerosenelabs/kindling/constant/HttpMethod.java +++ b/src/java/com/kerosenelabs/kindling/constant/HttpMethod.java @@ -1,4 +1,4 @@ -package io.kerosenelabs.kindling.constant; +package com.kerosenelabs.kindling.constant; public enum HttpMethod { GET, diff --git a/src/main/java/io/kerosenelabs/kindling/constant/HttpStatus.java b/src/java/com/kerosenelabs/kindling/constant/HttpStatus.java similarity index 95% rename from src/main/java/io/kerosenelabs/kindling/constant/HttpStatus.java rename to src/java/com/kerosenelabs/kindling/constant/HttpStatus.java index 62d755b..ab01b9f 100644 --- a/src/main/java/io/kerosenelabs/kindling/constant/HttpStatus.java +++ b/src/java/com/kerosenelabs/kindling/constant/HttpStatus.java @@ -1,4 +1,4 @@ -package io.kerosenelabs.kindling.constant; +package com.kerosenelabs.kindling.constant; public enum HttpStatus { OK(200, "OK"), diff --git a/src/main/java/io/kerosenelabs/kindling/constant/MimeType.java b/src/java/com/kerosenelabs/kindling/constant/MimeType.java similarity index 90% rename from src/main/java/io/kerosenelabs/kindling/constant/MimeType.java rename to src/java/com/kerosenelabs/kindling/constant/MimeType.java index 0e2b8c0..6144a2b 100644 --- a/src/main/java/io/kerosenelabs/kindling/constant/MimeType.java +++ b/src/java/com/kerosenelabs/kindling/constant/MimeType.java @@ -1,4 +1,4 @@ -package io.kerosenelabs.kindling.constant; +package com.kerosenelabs.kindling.constant; public enum MimeType { APPLICATION_JSON("application/json"), diff --git a/src/main/java/io/kerosenelabs/kindling/dto/HttpRequestHead.java b/src/java/com/kerosenelabs/kindling/dto/HttpRequestHead.java similarity index 85% rename from src/main/java/io/kerosenelabs/kindling/dto/HttpRequestHead.java rename to src/java/com/kerosenelabs/kindling/dto/HttpRequestHead.java index 1ce1004..3983442 100644 --- a/src/main/java/io/kerosenelabs/kindling/dto/HttpRequestHead.java +++ b/src/java/com/kerosenelabs/kindling/dto/HttpRequestHead.java @@ -1,6 +1,6 @@ -package io.kerosenelabs.kindling.dto; +package com.kerosenelabs.kindling.dto; -import io.kerosenelabs.kindling.constant.HttpMethod; +import com.kerosenelabs.kindling.constant.HttpMethod; public class HttpRequestHead { private HttpMethod httpMethod; diff --git a/src/main/java/io/kerosenelabs/kindling/exception/KindlingException.java b/src/java/com/kerosenelabs/kindling/exception/KindlingException.java similarity index 81% rename from src/main/java/io/kerosenelabs/kindling/exception/KindlingException.java rename to src/java/com/kerosenelabs/kindling/exception/KindlingException.java index e8eff37..32d4a32 100644 --- a/src/main/java/io/kerosenelabs/kindling/exception/KindlingException.java +++ b/src/java/com/kerosenelabs/kindling/exception/KindlingException.java @@ -1,4 +1,4 @@ -package io.kerosenelabs.kindling.exception; +package com.kerosenelabs.kindling.exception; public class KindlingException extends Exception { public KindlingException(Throwable e) { diff --git a/src/main/java/io/kerosenelabs/kindling/handler/RequestHandler.java b/src/java/com/kerosenelabs/kindling/handler/RequestHandler.java similarity index 59% rename from src/main/java/io/kerosenelabs/kindling/handler/RequestHandler.java rename to src/java/com/kerosenelabs/kindling/handler/RequestHandler.java index b8740d7..ca47c49 100644 --- a/src/main/java/io/kerosenelabs/kindling/handler/RequestHandler.java +++ b/src/java/com/kerosenelabs/kindling/handler/RequestHandler.java @@ -1,10 +1,10 @@ -package io.kerosenelabs.kindling.handler; +package com.kerosenelabs.kindling.handler; -import io.kerosenelabs.kindling.HttpRequest; -import io.kerosenelabs.kindling.HttpResponse; -import io.kerosenelabs.kindling.constant.HttpMethod; -import io.kerosenelabs.kindling.constant.HttpStatus; -import io.kerosenelabs.kindling.exception.KindlingException; +import com.kerosenelabs.kindling.HttpRequest; +import com.kerosenelabs.kindling.HttpResponse; +import com.kerosenelabs.kindling.constant.HttpMethod; +import com.kerosenelabs.kindling.constant.HttpStatus; +import com.kerosenelabs.kindling.exception.KindlingException; public abstract class RequestHandler { public abstract HttpResponse handle(HttpRequest httpRequest) throws KindlingException; @@ -12,7 +12,8 @@ public abstract class RequestHandler { public abstract boolean accepts(HttpRequest httpRequest) throws KindlingException; /** - * Called from {@link io.kerosenelabs.kindling.KindlingServer} if an error occurs during + * Called from {@link com.kerosenelabs.kindling.KindlingServer} if an error + * occurs during * {@link RequestHandler#handle(HttpRequest)} * * @param t the Throwable that occurred diff --git a/src/test/java/io/kerosenelabs/kindling/HttpServerTest.java b/src/test/java/io/kerosenelabs/kindling/HttpServerTest.java index cce66f2..55c15ce 100644 --- a/src/test/java/io/kerosenelabs/kindling/HttpServerTest.java +++ b/src/test/java/io/kerosenelabs/kindling/HttpServerTest.java @@ -1,5 +1,5 @@ -package io.kerosenelabs.kindling; +package com.kerosenelabs.kindling; public class HttpServerTest { - + } diff --git a/src/test/java/io/kerosenelabs/kindling/handler/HttpRequestTest.java b/src/test/java/io/kerosenelabs/kindling/handler/HttpRequestTest.java index 64db549..0c899be 100644 --- a/src/test/java/io/kerosenelabs/kindling/handler/HttpRequestTest.java +++ b/src/test/java/io/kerosenelabs/kindling/handler/HttpRequestTest.java @@ -1,4 +1,4 @@ -package io.kerosenelabs.kindling.handler; +package com.kerosenelabs.kindling.handler; import org.junit.jupiter.api.BeforeEach;