Class StaticContentFeature
java.lang.Object
io.helidon.webserver.staticcontent.StaticContentFeature
- All Implemented Interfaces:
RuntimeType.Api<StaticContentConfig>, Weighted, NamedService, 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 ServerFeature
ServerFeature.RoutingBuilders, ServerFeature.ServerFeatureContext, ServerFeature.SocketBuildersModifier and TypeInterfaceDescriptionstatic interfaceAccess to builders of various routing types.static interfaceA wrapping object to access various configurable elements of server forServerFeature.static interfaceA wrapping object to access listener related builders. -
Field Summary
Fields inherited from interface Weighted
DEFAULT_WEIGHTModifier and TypeFieldDescriptionstatic final doubleDefault weight for any weighted component (whether it implements this interface or usesWeightannotation). -
Method Summary
Modifier and TypeMethodDescriptionstatic StaticContentConfig.Builderbuilder()A new fluent API builder to create a static content feature.static StaticContentFeatureCreate a static content feature configured fromConfig.static StaticContentFeaturecreate(StaticContentConfig config) Create a new instance from its configuration.static StaticContentFeaturecreate(Consumer<StaticContentConfig.Builder> builderConsumer) Create a new instance customizing its configuration.static HttpServicecreateService(ClasspathHandlerConfig config) Create an Http service for classpath based content handler.static HttpServicecreateService(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.voidsetup(ServerFeature.ServerFeatureContext featureContext) Set up a server feature.type()Type of this implementation, to distinguish instances of same type, with differentNamedService.name().doubleweight()Weight of this class (maybe because it is defined dynamically, so it cannot be defined by an annotation).
-
Method Details
-
create
Create a static content feature configured fromConfig.- Parameters:
config- configuration for a new static content feature- Returns:
- a new static content feature to be registered with WebServer routing
-
builder
A new fluent API builder to create a static content feature.- 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.ApiThe prototype as it was received when creating this runtime object instance.- Specified by:
prototypein interfaceRuntimeType.Api<StaticContentConfig>- Returns:
- prototype object used to create this instance
-
name
Description copied from interface:NamedServiceName of this implementation, as provided inConfiguredProvider.create(Config, String).- Specified by:
namein interfaceNamedService- Returns:
- name of this service
-
type
Description copied from interface:NamedServiceType of this implementation, to distinguish instances of same type, with differentNamedService.name(). Use for exampleConfiguredProvider.configKey()to define the type.- Specified by:
typein interfaceNamedService- Returns:
- type of this service
-
weight
public double weight()Description copied from interface:WeightedWeight of this class (maybe because it is defined dynamically, so it cannot be defined by an annotation). If not dynamic, you can use theWeightannotation rather than implementing this interface as long as it is supported by the library using thisWeighted. -
setup
Description copied from interface:ServerFeatureSet 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:
setupin interfaceServerFeature- Parameters:
featureContext- to access builders of webserver, listeners, and routing
-