Interface StaticContentService
- All Superinterfaces:
HttpService
,ServerLifecycle
@Deprecated(forRemoval=true,
since="4.1.5")
public interface StaticContentService
extends HttpService
Deprecated, for removal: This API element is subject to removal in a future version.
Serves 'static content' (files) from filesystem or using a classloader to the
WebServer
HttpRouting
. It is possible to
register
it on the routing.
// Serve content of attached '/static/pictures' on '/pics'
Routing.builder()
.register("/pics", StaticContentSupport.create("/static/pictures"))
.build()
Content is served ONLY on HTTP GET
method.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic class
Deprecated, for removal: This API element is subject to removal in a future version.replaced withFileSystemHandlerConfig
andClasspathHandlerConfig
static class
Deprecated, for removal: This API element is subject to removal in a future version.Builder for class path based static content.static class
Deprecated, for removal: This API element is subject to removal in a future version.Builder for file based static content supports, such as file based and classpath based.static class
Deprecated, for removal: This API element is subject to removal in a future version.Builder for file system based static content. -
Method Summary
Modifier and TypeMethodDescriptionDeprecated, for removal: This API element is subject to removal in a future version.useClasspathHandlerConfig.builder()
insteadbuilder
(String resourceRoot, ClassLoader classLoader) Deprecated, for removal: This API element is subject to removal in a future version.useClasspathHandlerConfig.builder()
insteadDeprecated, for removal: This API element is subject to removal in a future version.useFileSystemHandlerConfig.builder()
insteadstatic StaticContentService
Deprecated, for removal: This API element is subject to removal in a future version.static StaticContentService
create
(String resourceRoot, ClassLoader classLoader) Deprecated, for removal: This API element is subject to removal in a future version.static StaticContentService
Deprecated, for removal: This API element is subject to removal in a future version.Methods inherited from interface io.helidon.webserver.http.HttpService
routing
Methods inherited from interface io.helidon.webserver.ServerLifecycle
afterStart, afterStop, beforeStart
-
Method Details
-
builder
@Deprecated(forRemoval=true, since="4.1.5") static StaticContentService.ClassPathBuilder builder(String resourceRoot) Deprecated, for removal: This API element is subject to removal in a future version.useClasspathHandlerConfig.builder()
insteadCreates new builder with defined static content root as a class-loader resource. Builder provides ability to define more advanced configuration.Current context classloader is used to load static content.
- Parameters:
resourceRoot
- a root resource path.- Returns:
- a builder
- Throws:
NullPointerException
- ifresourceRoot
attribute isnull
-
builder
@Deprecated(forRemoval=true, since="4.1.5") static StaticContentService.ClassPathBuilder builder(String resourceRoot, ClassLoader classLoader) Deprecated, for removal: This API element is subject to removal in a future version.useClasspathHandlerConfig.builder()
insteadCreates new builder with defined static content root as a class-loader resource. Builder provides ability to define more advanced configuration.- Parameters:
resourceRoot
- a root resource path.classLoader
- a class-loader for the static content- Returns:
- a builder
- Throws:
NullPointerException
- ifresourceRoot
attribute isnull
-
builder
@Deprecated(forRemoval=true, since="4.1.5") static StaticContentService.FileSystemBuilder builder(Path root) Deprecated, for removal: This API element is subject to removal in a future version.useFileSystemHandlerConfig.builder()
insteadCreates new builder with defined static content root as a path to the file system. Builder provides ability to define more advanced configuration.- Parameters:
root
- a root path.- Returns:
- a builder
- Throws:
NullPointerException
- ifroot
attribute isnull
-
create
Deprecated, for removal: This API element is subject to removal in a future version.Creates new instance with defined static content root as a class-loader resource.Current context classloader is used to load static content.
- Parameters:
resourceRoot
- a root resource path.- Returns:
- created instance
- Throws:
NullPointerException
- ifresourceRoot
attribute isnull
-
create
@Deprecated(forRemoval=true, since="4.1.5") static StaticContentService create(String resourceRoot, ClassLoader classLoader) Deprecated, for removal: This API element is subject to removal in a future version.Creates new instance with defined static content root as a class-loader resource.- Parameters:
resourceRoot
- a root resource path.classLoader
- a class-loader for the static content- Returns:
- created instance
- Throws:
NullPointerException
- ifresourceRoot
attribute isnull
-
create
Deprecated, for removal: This API element is subject to removal in a future version.Creates new instance with defined static content root as a path to the file system.- Parameters:
root
- a root path.- Returns:
- created instance
- Throws:
NullPointerException
- ifroot
attribute isnull
-
StaticContentFeature
instead, or if specific services are desired, kindly useStaticContentFeature.createService(ClasspathHandlerConfig)
and/orStaticContentFeature.createService(FileSystemHandlerConfig)