Class StaticContentConfig.BuilderBase<BUILDER extends StaticContentConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends StaticContentConfig>
java.lang.Object
io.helidon.webserver.staticcontent.StaticContentConfig.BuilderBase<BUILDER,PROTOTYPE>
- Type Parameters:
BUILDER
- type of the builder extending this abstract builderPROTOTYPE
- type of the prototype interface that would be built byPrototype.Builder.buildPrototype()
- All Implemented Interfaces:
Prototype.Builder<BUILDER,
,PROTOTYPE> ConfigBuilderSupport.ConfiguredBuilder<BUILDER,
PROTOTYPE>
- Direct Known Subclasses:
StaticContentConfig.Builder
- Enclosing interface:
StaticContentConfig
public abstract static class StaticContentConfig.BuilderBase<BUILDER extends StaticContentConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends StaticContentConfig>
extends Object
implements ConfigBuilderSupport.ConfiguredBuilder<BUILDER,PROTOTYPE>
Fluent API builder base for
StaticContentFeature
.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
Generated implementation of the prototype, can be extended by descendant prototype implementations. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddClasspath
(ClasspathHandlerConfig classpath) List of classpath based static content handlers.addClasspath
(Consumer<ClasspathHandlerConfig.Builder> consumer) List of classpath based static content handlers.addClasspath
(List<? extends ClasspathHandlerConfig> classpath) List of classpath based static content handlers.addContentTypes
(Map<String, ? extends MediaType> contentTypes) This method keeps existing values, then puts all new values into the map.List of file system based static content handlers.addPath
(Consumer<FileSystemHandlerConfig.Builder> consumer) List of file system based static content handlers.addPath
(List<? extends FileSystemHandlerConfig> path) List of file system based static content handlers.Sockets names (listeners) that will host static content handlers, defaults to all configured sockets.addSockets
(Set<String> sockets) Sockets names (listeners) that will host static content handlers, defaults to all configured sockets.List of classpath based static content handlers.classpath
(List<? extends ClasspathHandlerConfig> classpath) List of classpath based static content handlers.Clear existing value of this property.Clear existing value of this property.Clear existing value of this property.config()
If this instance was configured, this would be the config instance used.Update builder from configuration (node of this type).Maps a filename extension to the response content type.contentTypes
(Map<String, ? extends MediaType> contentTypes) This method replaces all values with the new ones.boolean
enabled()
Whether this feature is enabled, defaults totrue
.enabled
(boolean enabled) Whether this feature is enabled, defaults totrue
.from
(StaticContentConfig prototype) Update this builder from an existing prototype instance.from
(StaticContentConfig.BuilderBase<?, ?> builder) Update this builder from an existing prototype builder instance.Memory cache shared by the whole feature.memoryCache
(MemoryCache memoryCache) Memory cache shared by the whole feature.memoryCache
(MemoryCacheConfig memoryCacheConfig) Memory cache shared by the whole feature.memoryCache
(Consumer<MemoryCacheConfig.Builder> consumer) Memory cache shared by the whole feature.name()
Name of this instance.Name of this instance.path()
List of file system based static content handlers.path
(List<? extends FileSystemHandlerConfig> path) List of file system based static content handlers.protected void
Handles providers and decorators.putContentType
(String key, MediaType contentType) This method adds a new value to the map, or replaces it if the key already exists.sockets()
Sockets names (listeners) that will host static content handlers, defaults to all configured sockets.Sockets names (listeners) that will host static content handlers, defaults to all configured sockets.Temporary storage to use across all classpath handlers.temporaryStorage
(TemporaryStorage temporaryStorage) Temporary storage to use across all classpath handlers.temporaryStorage
(TemporaryStorageConfig temporaryStorageConfig) Temporary storage to use across all classpath handlers.Temporary storage to use across all classpath handlers.toString()
protected void
Validates required properties.double
weight()
Weight of the static content feature.weight
(double weight) Weight of the static content feature.welcome()
Welcome-file name.Welcome-file name.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.helidon.builder.api.Prototype.Builder
buildPrototype, self
-
Constructor Details
-
BuilderBase
protected BuilderBase()Protected to support extensibility.
-
-
Method Details
-
from
Update this builder from an existing prototype instance. This method disables automatic service discovery.- Parameters:
prototype
- existing prototype to update this builder from- Returns:
- updated builder instance
-
from
Update this builder from an existing prototype builder instance.- Parameters:
builder
- existing builder prototype to update this builder from- Returns:
- updated builder instance
-
config
Update builder from configuration (node of this type). If a value is present in configuration, it would override currently configured values.- Specified by:
config
in interfaceConfigBuilderSupport.ConfiguredBuilder<BUILDER extends StaticContentConfig.BuilderBase<BUILDER,
PROTOTYPE>, PROTOTYPE extends StaticContentConfig> - Parameters:
config
- configuration instance used to obtain values to update this builder- Returns:
- updated builder instance
-
enabled
Whether this feature is enabled, defaults totrue
.- Parameters:
enabled
- whether this feature is enabled- Returns:
- updated builder instance
- See Also:
-
weight
Weight of the static content feature. Defaults to 95.0.- Parameters:
weight
- weight of the feature- Returns:
- updated builder instance
- See Also:
-
name
Name of this instance.- Parameters:
name
- instance name- Returns:
- updated builder instance
- See Also:
-
clearMemoryCache
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
memoryCache
Memory cache shared by the whole feature. If not configured, files are not cached in memory (except for explicitly marked files/resources in each section).- Parameters:
memoryCache
- memory cache, if configured- Returns:
- updated builder instance
- See Also:
-
memoryCache
Memory cache shared by the whole feature. If not configured, files are not cached in memory (except for explicitly marked files/resources in each section).- Parameters:
memoryCacheConfig
- memory cache, if configured- Returns:
- updated builder instance
- See Also:
-
memoryCache
Memory cache shared by the whole feature. If not configured, files are not cached in memory (except for explicitly marked files/resources in each section).- Parameters:
consumer
- memory cache, if configured- Returns:
- updated builder instance
- See Also:
-
clearTemporaryStorage
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
temporaryStorage
Temporary storage to use across all classpath handlers. If not defined, a default one will be created.- Parameters:
temporaryStorage
- temporary storage- Returns:
- updated builder instance
- See Also:
-
temporaryStorage
Temporary storage to use across all classpath handlers. If not defined, a default one will be created.- Parameters:
temporaryStorageConfig
- temporary storage- Returns:
- updated builder instance
- See Also:
-
temporaryStorage
Temporary storage to use across all classpath handlers. If not defined, a default one will be created.- Parameters:
consumer
- temporary storage- Returns:
- updated builder instance
- See Also:
-
classpath
List of classpath based static content handlers.- Parameters:
classpath
- classpath handlers- Returns:
- updated builder instance
- See Also:
-
addClasspath
List of classpath based static content handlers.- Parameters:
classpath
- classpath handlers- Returns:
- updated builder instance
- See Also:
-
addClasspath
List of classpath based static content handlers.- Parameters:
classpath
- classpath handlers- Returns:
- updated builder instance
- See Also:
-
addClasspath
List of classpath based static content handlers.- Parameters:
consumer
- classpath handlers- Returns:
- updated builder instance
- See Also:
-
path
List of file system based static content handlers.- Parameters:
path
- path handlers- Returns:
- updated builder instance
- See Also:
-
addPath
List of file system based static content handlers.- Parameters:
path
- path handlers- Returns:
- updated builder instance
- See Also:
-
addPath
List of file system based static content handlers.- Parameters:
path
- path handlers- Returns:
- updated builder instance
- See Also:
-
addPath
List of file system based static content handlers.- Parameters:
consumer
- path handlers- Returns:
- updated builder instance
- See Also:
-
contentTypes
This method replaces all values with the new ones.- Parameters:
contentTypes
- map of file extensions to associated media type- Returns:
- updated builder instance
- See Also:
-
addContentTypes
This method keeps existing values, then puts all new values into the map.- Parameters:
contentTypes
- map of file extensions to associated media type- Returns:
- updated builder instance
- See Also:
-
putContentType
This method adds a new value to the map, or replaces it if the key already exists.- Parameters:
key
- key to add or replacecontentType
- new value for the key- Returns:
- updated builder instance
- See Also:
-
clearWelcome
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
welcome
Welcome-file name. Default for all handlers. By default, we do not serve default files.- Parameters:
welcome
- welcome-file name, such asindex.html
- Returns:
- updated builder instance
- See Also:
-
sockets
Sockets names (listeners) that will host static content handlers, defaults to all configured sockets. Default socket name is@default
.This configures defaults for all handlers.
- Parameters:
sockets
- sockets to register this handler on- Returns:
- updated builder instance
- See Also:
-
addSockets
Sockets names (listeners) that will host static content handlers, defaults to all configured sockets. Default socket name is@default
.This configures defaults for all handlers.
- Parameters:
sockets
- sockets to register this handler on- Returns:
- updated builder instance
- See Also:
-
addSocket
Sockets names (listeners) that will host static content handlers, defaults to all configured sockets. Default socket name is@default
.This configures defaults for all handlers.
- Parameters:
socket
- sockets to register this handler on- Returns:
- updated builder instance
- See Also:
-
enabled
public boolean enabled()Whether this feature is enabled, defaults totrue
.- Returns:
- the enabled
-
weight
public double weight()Weight of the static content feature. Defaults to 95.0.- Returns:
- the weight
-
name
Name of this instance.- Returns:
- the name
-
memoryCache
Memory cache shared by the whole feature. If not configured, files are not cached in memory (except for explicitly marked files/resources in each section).- Returns:
- the memory cache
-
temporaryStorage
Temporary storage to use across all classpath handlers. If not defined, a default one will be created.- Returns:
- the temporary storage
-
classpath
List of classpath based static content handlers.- Returns:
- the classpath
-
path
List of file system based static content handlers.- Returns:
- the path
-
contentTypes
Maps a filename extension to the response content type. To have a system-wide configuration, you can use the service loader SPIMediaTypeDetector
.This method can override
MediaTypes
detection for a specific static content handler.Handler will use a union of configuration defined here, and on the handler here when used from configuration.
- Returns:
- the content types
-
welcome
Welcome-file name. Default for all handlers. By default, we do not serve default files.- Returns:
- the welcome
-
sockets
Sockets names (listeners) that will host static content handlers, defaults to all configured sockets. Default socket name is@default
.This configures defaults for all handlers.
- Returns:
- the sockets
-
config
If this instance was configured, this would be the config instance used.- Returns:
- config node used to configure this builder, or empty if not configured
-
toString
-
preBuildPrototype
protected void preBuildPrototype()Handles providers and decorators. -
validatePrototype
protected void validatePrototype()Validates required properties.
-