diff --git a/avaje-jex-static-content/src/main/java/io/avaje/jex/staticcontent/StaticContent.java b/avaje-jex-static-content/src/main/java/io/avaje/jex/staticcontent/StaticContent.java index 0efd677e..337d9fee 100644 --- a/avaje-jex-static-content/src/main/java/io/avaje/jex/staticcontent/StaticContent.java +++ b/avaje-jex-static-content/src/main/java/io/avaje/jex/staticcontent/StaticContent.java @@ -31,7 +31,7 @@ public sealed interface StaticContent extends JexPlugin * * @param resourceRoot The file to serve, or the directory the files are located in. */ - static Builder createCP(String resourceRoot) { + static Builder ofClassPath(String resourceRoot) { return StaticResourceHandlerBuilder.builder(resourceRoot); } @@ -39,7 +39,7 @@ static Builder createCP(String resourceRoot) { * Create and return a new static content class path configuration with the * `/public` directory as the root. */ - static Builder createCP() { + static Builder ofClassPath() { return StaticResourceHandlerBuilder.builder("/public/"); } @@ -48,7 +48,7 @@ static Builder createCP() { * * @param resourceRoot The path of the file to serve, or the directory the files are located in. */ - static Builder createFile(String resourceRoot) { + static Builder ofFile(String resourceRoot) { return StaticResourceHandlerBuilder.builder(resourceRoot).file(); } diff --git a/avaje-jex-static-content/src/test/java/io/avaje/jex/staticcontent/CompressedStaticFileTest.java b/avaje-jex-static-content/src/test/java/io/avaje/jex/staticcontent/CompressedStaticFileTest.java index ae712260..b57259f8 100644 --- a/avaje-jex-static-content/src/test/java/io/avaje/jex/staticcontent/CompressedStaticFileTest.java +++ b/avaje-jex-static-content/src/test/java/io/avaje/jex/staticcontent/CompressedStaticFileTest.java @@ -25,22 +25,22 @@ static TestPair init() { .plugin(defaultFile().route("/indexWildFile/*").build()) .plugin(defaultCP().route("/sus/").build()) .plugin(defaultFile().route("/susFile/*").build()) - .plugin(StaticContent.createCP("/logback.xml").route("/single").build()) + .plugin(StaticContent.ofClassPath("/logback.xml").route("/single").build()) .plugin( - StaticContent.createFile("src/test/resources/logback.xml") + StaticContent.ofFile("src/test/resources/logback.xml") .route("/singleFile").build()); return TestPair.create(app); } private static StaticContent.Builder defaultFile() { - return StaticContent.createFile("src/test/resources/public") + return StaticContent.ofFile("src/test/resources/public") .directoryIndex("index.html") .preCompress(); } private static StaticContent.Builder defaultCP() { - return StaticContent.createCP("/public") + return StaticContent.ofClassPath("/public") .directoryIndex("index.html") .preCompress(); } diff --git a/avaje-jex-static-content/src/test/java/io/avaje/jex/staticcontent/StaticFileTest.java b/avaje-jex-static-content/src/test/java/io/avaje/jex/staticcontent/StaticFileTest.java index 752828ba..ffe40d85 100644 --- a/avaje-jex-static-content/src/test/java/io/avaje/jex/staticcontent/StaticFileTest.java +++ b/avaje-jex-static-content/src/test/java/io/avaje/jex/staticcontent/StaticFileTest.java @@ -25,21 +25,21 @@ static TestPair init() { .plugin(defaultFile().route("/indexWildFile/*").build()) .plugin(defaultCP().route("/sus/").build()) .plugin(defaultFile().route("/susFile/*").build()) - .plugin(StaticContent.createCP("/logback.xml").route("/single").build()) + .plugin(StaticContent.ofClassPath("/logback.xml").route("/single").build()) .plugin( - StaticContent.createFile("src/test/resources/logback.xml") + StaticContent.ofFile("src/test/resources/logback.xml") .route("/singleFile").build()); return TestPair.create(app); } private static StaticContent.Builder defaultFile() { - return StaticContent.createFile("src/test/resources/public") + return StaticContent.ofFile("src/test/resources/public") .directoryIndex("index.html"); } private static StaticContent.Builder defaultCP() { - return StaticContent.createCP("/public").directoryIndex("index.html"); + return StaticContent.ofClassPath("/public").directoryIndex("index.html"); } @AfterAll diff --git a/avaje-jex/src/main/java/io/avaje/jex/core/JdkContext.java b/avaje-jex/src/main/java/io/avaje/jex/core/JdkContext.java index 3e5f5ddc..cfd2a8d1 100644 --- a/avaje-jex/src/main/java/io/avaje/jex/core/JdkContext.java +++ b/avaje-jex/src/main/java/io/avaje/jex/core/JdkContext.java @@ -222,7 +222,7 @@ public Map> formParamMap() { private String header(Headers headers, String name) { final List values = headers.get(name); - return (values == null || values.isEmpty()) ? null : values.getFirst(); + return values == null || values.isEmpty() ? null : values.getFirst(); } @Override