public class StaticContentSupport extends 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", StaticContentSupport.create("/static/pictures"))
.build()
Content is served ONLY on HTTP GET method.
| Modifier and Type | Class and Description |
|---|---|
static class |
StaticContentSupport.Builder
Fluent builder of the StaticContent detailed parameters.
|
| Modifier and Type | Method and Description |
|---|---|
static StaticContentSupport.Builder |
builder(Path root)
Creates new builder with defined static content root as a path to the file system.
|
static StaticContentSupport.Builder |
builder(String resourceRoot)
Creates new builder with defined static content root as a class-loader resource.
|
static StaticContentSupport.Builder |
builder(String resourceRoot,
ClassLoader classLoader)
Creates new builder with defined static content root as a class-loader resource.
|
static StaticContentSupport |
create(Path root)
Creates new instance with defined static content root as a path to the file system.
|
static StaticContentSupport |
create(String resourceRoot)
Creates new instance with defined static content root as a class-loader resource.
|
static StaticContentSupport |
create(String resourceRoot,
ClassLoader classLoader)
Creates new instance with defined static content root as a class-loader resource.
|
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(String resourceRoot)
Current context classloader is used to load static content.
resourceRoot - a root resource path.NullPointerException - if resourceRoot attribute is nullpublic static StaticContentSupport.Builder builder(String resourceRoot, ClassLoader classLoader)
resourceRoot - a root resource path.classLoader - a class-loader for the static contentNullPointerException - if resourceRoot attribute is nullpublic static StaticContentSupport.Builder builder(Path root)
root - a root path.NullPointerException - if root attribute is nullpublic static StaticContentSupport create(String resourceRoot)
Current context classloader is used to load static content.
resourceRoot - a root resource path.NullPointerException - if resourceRoot attribute is nullpublic static StaticContentSupport create(String resourceRoot, ClassLoader classLoader)
resourceRoot - a root resource path.classLoader - a class-loader for the static contentNullPointerException - if resourceRoot attribute is nullpublic static StaticContentSupport create(Path root)
root - a root path.NullPointerException - if root attribute is nullCopyright © 2018, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.