Class StaticContentFeature
java.lang.Object
io.helidon.webserver.staticcontent.StaticContentFeature
- All Implemented Interfaces:
RuntimeType.Api<StaticContentConfig>
,NamedService
,Weighted
,ServerFeature
,Comparable<Weighted>
public class StaticContentFeature
extends Object
implements Weighted, ServerFeature, RuntimeType.Api<StaticContentConfig>
WebServer feature to register static content.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.helidon.webserver.spi.ServerFeature
ServerFeature.RoutingBuilders, ServerFeature.ServerFeatureContext, ServerFeature.SocketBuilders
-
Field Summary
Fields inherited from interface io.helidon.common.Weighted
DEFAULT_WEIGHT
-
Method Summary
Modifier and TypeMethodDescriptionstatic StaticContentConfig.Builder
builder()
A new fluent API builder to create Access log support instance.static StaticContentFeature
Create Access log support configured fromConfig
.static StaticContentFeature
create
(StaticContentConfig config) Create a new instance from its configuration.static StaticContentFeature
create
(Consumer<StaticContentConfig.Builder> builderConsumer) Create a new instance customizing its configuration.static HttpService
createService
(ClasspathHandlerConfig config) Create an Http service for classpath based content handler.static HttpService
createService
(FileSystemHandlerConfig config) Create an Http service for file system based content handler.name()
Name of this implementation, as provided inConfiguredProvider.create(Config, String)
.The prototype as it was received when creating this runtime object instance.void
setup
(ServerFeature.ServerFeatureContext featureContext) Set up a server feature.type()
Type of this implementation, to distinguish instances of same type, with differentNamedService.name()
.
-
Method Details
-
create
Create Access log support configured fromConfig
.- Parameters:
config
- to configure a new access log support instance- Returns:
- a new access log support to be registered with WebServer routing
-
builder
A new fluent API builder to create Access log support instance.- Returns:
- a new builder
-
create
Create a new instance from its configuration.- Parameters:
config
- configuration- Returns:
- a new feature
-
create
Create a new instance customizing its configuration.- Parameters:
builderConsumer
- consumer of configuration- Returns:
- a new feature
-
createService
Create an Http service for file system based content handler.- Parameters:
config
- configuration of the content handler- Returns:
- a new HTTP service ready to be registered
-
createService
Create an Http service for classpath based content handler.- Parameters:
config
- configuration of the content handler- Returns:
- a new HTTP service ready to be registered
-
prototype
Description copied from interface:RuntimeType.Api
The prototype as it was received when creating this runtime object instance.- Specified by:
prototype
in interfaceRuntimeType.Api<StaticContentConfig>
- Returns:
- prototype object used to create this instance
-
name
Description copied from interface:NamedService
Name of this implementation, as provided inConfiguredProvider.create(Config, String)
.- Specified by:
name
in interfaceNamedService
- Returns:
- name of this service
-
type
Description copied from interface:NamedService
Type of this implementation, to distinguish instances of same type, with differentNamedService.name()
. Use for exampleConfiguredProvider.configKey()
to define the type.- Specified by:
type
in interfaceNamedService
- Returns:
- type of this service
-
setup
Description copied from interface:ServerFeature
Set up a server feature. Server features can modify server configuration, right before the server is created. To access listener configuration, or routing, a list of all listeners is provided.- Specified by:
setup
in interfaceServerFeature
- Parameters:
featureContext
- to access builders of webserver, listeners, and routing
-