Class StaticContentConfig.BuilderBase<BUILDER extends StaticContentConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends StaticContentConfig>
- 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> ConfigBuilderSupport.ConfiguredBuilder<BUILDER,PROTOTYPE>
- Direct Known Subclasses:
StaticContentConfig.Builder
- Enclosing interface:
StaticContentConfig
StaticContentConfig.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classGenerated 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) Maps a filename extension to the response content type.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 all classpath.Clear existing value of memoryCache.Clear all path.Clear all sockets.Clear existing value of temporaryStorage.Clear existing value of welcome.config()Configuration used to configure this instance.Deprecated.Update builder from configuration (node of this type).Maps a filename extension to the response content type.contentTypes(Map<String, ? extends MediaType> contentTypes) Maps a filename extension to the response content type.booleanenabled()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 memoryCache) 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 voidHandles providers and decorators.putContentType(String key, MediaType contentType) Maps a filename extension to the response content type.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 temporaryStorage) Temporary storage to use across all classpath handlers.Temporary storage to use across all classpath handlers.toString()protected voidValidates required properties.doubleweight()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, waitMethods 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
Deprecated.Update builder from configuration (node of this type). If a value is present in configuration, it would override currently configured values.- Specified by:
configin 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
-
config
Update builder from configuration (node of this type). If a value is present in configuration, it would override currently configured values.- Specified by:
configin 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 memoryCache.- 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:
memoryCache- prototype of 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- consumer of builder of memory cache, if configured- Returns:
- updated builder instance
- See Also:
-
clearTemporaryStorage
Clear existing value of temporaryStorage.- 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:
temporaryStorage- prototype of 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- consumer of builder of temporary storage- Returns:
- updated builder instance
- See Also:
-
clearClasspath
Clear all classpath.- 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- add single classpath handlers- Returns:
- updated builder instance
- See Also:
-
addClasspath
List of classpath based static content handlers.- Parameters:
consumer- consumer of builder for classpath handlers- Returns:
- updated builder instance
- See Also:
-
clearPath
Clear all path.- 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- add single path handlers- Returns:
- updated builder instance
- See Also:
-
addPath
List of file system based static content handlers.- Parameters:
consumer- consumer of builder for path handlers- Returns:
- updated builder instance
- See Also:
-
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
MediaTypesdetection for a specific static content handler.Handler will use a union of configuration defined here, and on the handler here when used from configuration. 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
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
MediaTypesdetection for a specific static content handler.Handler will use a union of configuration defined here, and on the handler here when used from configuration. 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
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
MediaTypesdetection for a specific static content handler.Handler will use a union of configuration defined here, and on the handler here when used from configuration. 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 welcome.- 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:
-
clearSockets
Clear all sockets.- 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- add single sockets to register this handler on- Returns:
- updated builder instance
- See Also:
-
enabled
public boolean enabled()Whether this feature is enabled, defaults totrue.- Returns:
- whether this feature is enabled
-
weight
public double weight()Weight of the static content feature. Defaults to 95.0.- Returns:
- weight of the feature
-
name
Name of this instance.- Returns:
- instance 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:
- memory cache, if configured
-
temporaryStorage
Temporary storage to use across all classpath handlers. If not defined, a default one will be created.- Returns:
- temporary storage
-
classpath
List of classpath based static content handlers.- Returns:
- classpath handlers
-
path
List of file system based static content handlers.- Returns:
- path handlers
-
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
MediaTypesdetection 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:
- map of file extensions to associated media type
-
welcome
Welcome-file name. Default for all handlers. By default, we do not serve default files.- Returns:
- welcome-file name, such as
index.html
-
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:
- sockets to register this handler on
-
toString
-
preBuildPrototype
protected void preBuildPrototype()Handles providers and decorators. -
validatePrototype
protected void validatePrototype()Validates required properties. -
config
Configuration used to configure this instance.- Returns:
- config instance
-
config(io.helidon.config.Config)