Skip to content

Commit

Permalink
Switching to Espresso
Browse files Browse the repository at this point in the history
  • Loading branch information
hlafaille committed Sep 30, 2024
1 parent 5ef76f6 commit 5fff903
Show file tree
Hide file tree
Showing 49 changed files with 50 additions and 88 deletions.
1 change: 0 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
"github.vscode-github-actions",
"GitHub.vscode-pull-request-github",
"redhat.vscode-yaml",
"vscjava.vscode-maven",
"redhat.vscode-xml"
],
"settings": {
Expand Down
3 changes: 3 additions & 0 deletions build/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Manifest-Version: 1.0
Main-Class: com.kerosenelabs.kindling.Main
Created-By: Espresso
Binary file added build/com/kerosenelabs/kindling/HttpRequest.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added build/com/kerosenelabs/kindling/Main$1$1.class
Binary file not shown.
Binary file added build/com/kerosenelabs/kindling/Main$1.class
Binary file not shown.
Binary file added build/com/kerosenelabs/kindling/Main.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added build/io/kerosenelabs/kindling/HttpRequest.class
Binary file not shown.
Binary file not shown.
Binary file added build/io/kerosenelabs/kindling/HttpResponse.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added build/io/kerosenelabs/kindling/Main$1$1.class
Binary file not shown.
Binary file added build/io/kerosenelabs/kindling/Main$1.class
Binary file not shown.
Binary file added build/io/kerosenelabs/kindling/Main.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added dist/dist.jar
Binary file not shown.
Binary file added espresso
Binary file not shown.
13 changes: 13 additions & 0 deletions espresso.yml
Original file line number Diff line number Diff line change
@@ -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
54 changes: 0 additions & 54 deletions pom.xml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.kerosenelabs.kindling;
package com.kerosenelabs.kindling;

import java.io.BufferedReader;
import java.io.IOException;
Expand All @@ -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}.
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.kerosenelabs.kindling;
package com.kerosenelabs.kindling;

import java.io.BufferedReader;
import java.io.IOException;
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.kerosenelabs.kindling;
package com.kerosenelabs.kindling;

public interface WorkerThreadNameGenerator {
public String generate();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.kerosenelabs.kindling.constant;
package com.kerosenelabs.kindling.constant;

public enum HttpMethod {
GET,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.kerosenelabs.kindling.constant;
package com.kerosenelabs.kindling.constant;

public enum HttpStatus {
OK(200, "OK"),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.kerosenelabs.kindling.constant;
package com.kerosenelabs.kindling.constant;

public enum MimeType {
APPLICATION_JSON("application/json"),
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.kerosenelabs.kindling.exception;
package com.kerosenelabs.kindling.exception;

public class KindlingException extends Exception {
public KindlingException(Throwable e) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
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;

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
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/io/kerosenelabs/kindling/HttpServerTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package io.kerosenelabs.kindling;
package com.kerosenelabs.kindling;

public class HttpServerTest {

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.kerosenelabs.kindling.handler;
package com.kerosenelabs.kindling.handler;

import org.junit.jupiter.api.BeforeEach;

Expand Down

0 comments on commit 5fff903

Please sign in to comment.