diff --git a/net-http-htmlflow/NOTICE.txt b/net-http-htmlflow/NOTICE.txt deleted file mode 100644 index e85e335..0000000 --- a/net-http-htmlflow/NOTICE.txt +++ /dev/null @@ -1,4 +0,0 @@ - -The htmlflow project is not enabled for Java modules. - -Maybe the dependencies are wrong. The asm-parent pom dependency can not be a module. diff --git a/net-http-htmlflow/build.gradle b/net-http-htmlflow/build.gradle deleted file mode 100644 index 16a18a3..0000000 --- a/net-http-htmlflow/build.gradle +++ /dev/null @@ -1,4 +0,0 @@ -dependencies { - api project(':net-http-server') - api libs.htmlflow -} diff --git a/net-http-htmlflow/src/main/java/module-info.java b/net-http-htmlflow/src/main/java/module-info.java deleted file mode 100644 index b2b20dc..0000000 --- a/net-http-htmlflow/src/main/java/module-info.java +++ /dev/null @@ -1,8 +0,0 @@ -module org.xbib.net.http.htmlflow { - exports org.xbib.net.http.htmlflow; - requires org.xbib.net; - requires org.xbib.net.http; - requires org.xbib.net.http.server; - requires org.xbib.config; - requires java.logging; -} \ No newline at end of file diff --git a/net-http-htmlflow/src/main/java/org/xbib/net/http/htmlflow/HtmlFlowResourceHandler.java b/net-http-htmlflow/src/main/java/org/xbib/net/http/htmlflow/HtmlFlowResourceHandler.java deleted file mode 100644 index 992c090..0000000 --- a/net-http-htmlflow/src/main/java/org/xbib/net/http/htmlflow/HtmlFlowResourceHandler.java +++ /dev/null @@ -1,60 +0,0 @@ -package org.xbib.net.http.htmlflow; - -import org.xbib.net.Attributes; -import org.xbib.net.Resource; -import org.xbib.net.buffer.DataBuffer; -import org.xbib.net.http.HttpResponseStatus; -import org.xbib.net.http.server.application.Application; -import org.xbib.net.http.server.resource.HtmlTemplateResource; -import org.xbib.net.http.server.resource.HtmlTemplateResourceHandler; -import org.xbib.net.http.server.route.HttpRouterContext; - -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.nio.file.Path; -import java.util.logging.Level; -import java.util.logging.Logger; - -import static org.xbib.net.http.HttpHeaderNames.CONTENT_TYPE; - -public class HtmlFlowResourceHandler extends HtmlTemplateResourceHandler { - - public HtmlFlowResourceHandler(Path root, String suffix, String indexFileName) { - super(root, suffix, indexFileName); - } - - @Override - protected Resource createResource(HttpRouterContext httpRouterContext) throws IOException { - return new HtmlFlowResource(this, httpRouterContext); - } - - protected static class HtmlFlowResource extends HtmlTemplateResource { - - private static final Logger logger = Logger.getLogger(HtmlFlowResource.class.getName()); - - protected HtmlFlowResource(HtmlTemplateResourceHandler templateResourceHandler, HttpRouterContext httpRouterContext) throws IOException { - super(templateResourceHandler, httpRouterContext); - } - - @Override - public void render(HttpRouterContext context) throws IOException { - Application application = context.getAttributes().get(Application.class, "application"); - if (application == null) { - logger.log(Level.WARNING, "application is null"); - return; - } - DataBuffer dataBuffer = context.getDataBufferFactory().allocateBuffer(); - dataBuffer.write(render(application, context.getAttributes()), StandardCharsets.UTF_8); - HttpResponseStatus httpResponseStatus = context.getAttributes().get(HttpResponseStatus.class, "_status", HttpResponseStatus.OK); - context.status(httpResponseStatus) - .header("cache-control", "no-cache") // override default must-revalidate behavior - .header("content-length", Integer.toString(dataBuffer.writePosition())) - .header(CONTENT_TYPE, "text/html; charset=" + StandardCharsets.UTF_8.displayName()) - .body(dataBuffer); - } - - protected String render(Application application, Attributes attributes) { - return null; - } - } -} diff --git a/net-http-htmlflow/src/main/java/org/xbib/net/http/htmlflow/HtmlFlowService.java b/net-http-htmlflow/src/main/java/org/xbib/net/http/htmlflow/HtmlFlowService.java deleted file mode 100644 index 36fd756..0000000 --- a/net-http-htmlflow/src/main/java/org/xbib/net/http/htmlflow/HtmlFlowService.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.xbib.net.http.htmlflow; - -import org.xbib.net.http.server.service.BaseHttpService; -import org.xbib.net.http.server.service.BaseHttpServiceBuilder; - -public class HtmlFlowService extends BaseHttpService { - - protected HtmlFlowService(BaseHttpServiceBuilder builder) { - super(builder); - } - - public static HtmlFlowServiceBuilder builder() { - return new HtmlFlowServiceBuilder(); - } -} diff --git a/net-http-htmlflow/src/main/java/org/xbib/net/http/htmlflow/HtmlFlowServiceBuilder.java b/net-http-htmlflow/src/main/java/org/xbib/net/http/htmlflow/HtmlFlowServiceBuilder.java deleted file mode 100644 index 3815cbc..0000000 --- a/net-http-htmlflow/src/main/java/org/xbib/net/http/htmlflow/HtmlFlowServiceBuilder.java +++ /dev/null @@ -1,69 +0,0 @@ -package org.xbib.net.http.htmlflow; - -import org.xbib.net.ParameterDefinition; -import org.xbib.net.http.HttpMethod; -import org.xbib.net.http.server.HttpHandler; -import org.xbib.net.http.server.domain.HttpSecurityDomain; -import org.xbib.net.http.server.service.BaseHttpServiceBuilder; - -import java.nio.file.Path; - -public class HtmlFlowServiceBuilder extends BaseHttpServiceBuilder { - - protected Path prefix; - - protected String suffix; - - public HtmlFlowServiceBuilder() { - super(); - this.prefix = null; - } - - @Override - public HtmlFlowServiceBuilder setPath(String path) { - super.setPath(path); - return this; - } - - @Override - public HtmlFlowServiceBuilder setMethod(HttpMethod... httpMethod) { - super.setMethod(httpMethod); - return this; - } - - @Override - public HtmlFlowServiceBuilder setHandler(HttpHandler... handler) { - super.setHandler(handler); - return this; - } - - @Override - public HtmlFlowServiceBuilder setParameterDefinition(ParameterDefinition... parameterDefinition) { - super.setParameterDefinition(parameterDefinition); - return this; - } - - @Override - public HtmlFlowServiceBuilder setSecurityDomain(HttpSecurityDomain securityDomain) { - super.setSecurityDomain(securityDomain); - return this; - } - - public HtmlFlowServiceBuilder setPrefix(Path prefix) { - this.prefix = prefix; - return this; - } - - public HtmlFlowServiceBuilder setSuffix(String suffix) { - this.suffix = suffix; - return this; - } - - public HtmlFlowService build() { - if (this.handlers == null) { - HttpHandler httpHandler = new HtmlFlowResourceHandler(prefix, suffix, "index.java"); - setHandler(httpHandler); - } - return new HtmlFlowService(this); - } -}