Servicepublic class StaticContentSupport extends java.lang.Object implements Service
WebServer
Routing. It is possible to register it on the routing.
// Server content of attached '/static/pictures' on '/pictures'
Routing.builder()
.register("/pics", StaticContent.create("/static/pictures"))
.build()
Content is served ONLY on HTTP GET method.
| Modifier and Type | Class | Description |
|---|---|---|
static class |
StaticContentSupport.Builder |
Fluent builder of the StaticContent detailed parameters.
|
| Modifier and Type | Method | Description |
|---|---|---|
static StaticContentSupport.Builder |
builder(java.lang.String resourceRoot) |
Creates new builder with defined static content root as a class-loader resource.
|
static StaticContentSupport.Builder |
builder(java.lang.String resourceRoot,
java.lang.ClassLoader classLoader) |
Creates new builder with defined static content root as a class-loader resource.
|
static StaticContentSupport.Builder |
builder(java.nio.file.Path root) |
Creates new builder with defined static content root as a path to the file system.
|
static StaticContentSupport |
create(java.lang.String resourceRoot) |
Creates new instance with defined static content root as a class-loader resource.
|
static StaticContentSupport |
create(java.lang.String resourceRoot,
java.lang.ClassLoader classLoader) |
Creates new instance with defined static content root as a class-loader resource.
|
static StaticContentSupport |
create(java.nio.file.Path root) |
Creates new instance with defined static content root as a path to the file system.
|
void |
update(Routing.Rules routing) |
Updates
Routing.Rules with handlers representing this service. |
public void update(Routing.Rules routing)
ServiceRouting.Rules with handlers representing this service.public static StaticContentSupport.Builder builder(java.lang.String resourceRoot)
Current context classloader is used to load static content.
resourceRoot - a root resource path.java.lang.NullPointerException - if resourceRoot attribute is nullpublic static StaticContentSupport.Builder builder(java.lang.String resourceRoot, java.lang.ClassLoader classLoader)
resourceRoot - a root resource path.classLoader - a class-loader for the static contentjava.lang.NullPointerException - if resourceRoot attribute is nullpublic static StaticContentSupport.Builder builder(java.nio.file.Path root)
root - a root path.java.lang.NullPointerException - if root attribute is nullpublic static StaticContentSupport create(java.lang.String resourceRoot)
Current context classloader is used to load static content.
resourceRoot - a root resource path.java.lang.NullPointerException - if resourceRoot attribute is nullpublic static StaticContentSupport create(java.lang.String resourceRoot, java.lang.ClassLoader classLoader)
resourceRoot - a root resource path.classLoader - a class-loader for the static contentjava.lang.NullPointerException - if resourceRoot attribute is nullpublic static StaticContentSupport create(java.nio.file.Path root)
root - a root path.java.lang.NullPointerException - if root attribute is nullCopyright © 2018, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.