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>
- 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.addPreCompressedEncodings(Map<String, String> preCompressedEncodings) Pre-compressed content coding to file suffix mappings; defaults include br to br and gzip to gz, handler-level mappings replace these mappings rather than merging with them, an explicit empty map disables sidecar lookups by default, codings must be unique concrete valid HTTP tokens other thanidentityand*, and suffixes have leading dots ignored and must not contain path separators.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.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.booleanWhether classpath sidecar resources may be sourced from a different classpath origin than the logical resource by default for feature-registered handlers.preCompressedCrossOriginSourcingEnabled(boolean preCompressedCrossOriginSourcingEnabled) Whether classpath sidecar resources may be sourced from a different classpath origin than the logical resource by default for feature-registered handlers.booleanWhether pre-compressed sidecar resources should be selected by default for feature-registered directory and classpath handlers; this is disabled by default and does not apply to file system handlers configured with a single file, which require handler-level opt-in.preCompressedEnabled(boolean preCompressedEnabled) Whether pre-compressed sidecar resources should be selected by default for feature-registered directory and classpath handlers; this is disabled by default and does not apply to file system handlers configured with a single file, which require handler-level opt-in.Pre-compressed content coding to file suffix mappings; defaults include br to br and gzip to gz, handler-level mappings replace these mappings rather than merging with them, an explicit empty map disables sidecar lookups by default, codings must be unique concrete valid HTTP tokens other thanidentityand*, and suffixes have leading dots ignored and must not contain path separators.preCompressedEncodings(Map<String, String> preCompressedEncodings) Pre-compressed content coding to file suffix mappings; defaults include br to br and gzip to gz, handler-level mappings replace these mappings rather than merging with them, an explicit empty map disables sidecar lookups by default, codings must be unique concrete valid HTTP tokens other thanidentityand*, and suffixes have leading dots ignored and must not contain path separators.putContentType(String key, MediaType contentType) Maps a filename extension to the response content type.putPreCompressedEncoding(String key, String preCompressedEncoding) Pre-compressed content coding to file suffix mappings; defaults include br to br and gzip to gz, handler-level mappings replace these mappings rather than merging with them, an explicit empty map disables sidecar lookups by default, codings must be unique concrete valid HTTP tokens other thanidentityand*, and suffixes have leading dots ignored and must not contain path separators.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 Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface 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:
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
-
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
-
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
-
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
-
clearSockets
-
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:
-
preCompressedEnabled
Whether pre-compressed sidecar resources should be selected by default for feature-registered directory and classpath handlers; this is disabled by default and does not apply to file system handlers configured with a single file, which require handler-level opt-in.- Parameters:
preCompressedEnabled- whether pre-compressed sidecar resources should be used- Returns:
- updated builder instance
- See Also:
-
preCompressedCrossOriginSourcingEnabled
public BUILDER preCompressedCrossOriginSourcingEnabled(boolean preCompressedCrossOriginSourcingEnabled) Whether classpath sidecar resources may be sourced from a different classpath origin than the logical resource by default for feature-registered handlers.- Parameters:
preCompressedCrossOriginSourcingEnabled- whether cross-origin classpath sidecar sourcing is enabled by default- Returns:
- updated builder instance
- See Also:
-
preCompressedEncodings
Pre-compressed content coding to file suffix mappings; defaults include br to br and gzip to gz, handler-level mappings replace these mappings rather than merging with them, an explicit empty map disables sidecar lookups by default, codings must be unique concrete valid HTTP tokens other thanidentityand*, and suffixes have leading dots ignored and must not contain path separators. This method replaces all values with the new ones.- Parameters:
preCompressedEncodings- content coding to file suffix mappings- Returns:
- updated builder instance
- See Also:
-
addPreCompressedEncodings
Pre-compressed content coding to file suffix mappings; defaults include br to br and gzip to gz, handler-level mappings replace these mappings rather than merging with them, an explicit empty map disables sidecar lookups by default, codings must be unique concrete valid HTTP tokens other thanidentityand*, and suffixes have leading dots ignored and must not contain path separators. This method keeps existing values, then puts all new values into the map.- Parameters:
preCompressedEncodings- content coding to file suffix mappings- Returns:
- updated builder instance
- See Also:
-
putPreCompressedEncoding
Pre-compressed content coding to file suffix mappings; defaults include br to br and gzip to gz, handler-level mappings replace these mappings rather than merging with them, an explicit empty map disables sidecar lookups by default, codings must be unique concrete valid HTTP tokens other thanidentityand*, and suffixes have leading dots ignored and must not contain path separators. This method adds a new value to the map, or replaces it if the key already exists.- Parameters:
key- key to add or replacepreCompressedEncoding- new value for the key- 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
-
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
-
sockets
-
preCompressedEnabled
public boolean preCompressedEnabled()Whether pre-compressed sidecar resources should be selected by default for feature-registered directory and classpath handlers; this is disabled by default and does not apply to file system handlers configured with a single file, which require handler-level opt-in.- Returns:
- whether pre-compressed sidecar resources should be used
-
preCompressedCrossOriginSourcingEnabled
public boolean preCompressedCrossOriginSourcingEnabled()Whether classpath sidecar resources may be sourced from a different classpath origin than the logical resource by default for feature-registered handlers.- Returns:
- whether cross-origin classpath sidecar sourcing is enabled by default
-
preCompressedEncodings
Pre-compressed content coding to file suffix mappings; defaults include br to br and gzip to gz, handler-level mappings replace these mappings rather than merging with them, an explicit empty map disables sidecar lookups by default, codings must be unique concrete valid HTTP tokens other thanidentityand*, and suffixes have leading dots ignored and must not contain path separators.- Returns:
- content coding to file suffix mappings
-
toString
-
preBuildPrototype
protected void preBuildPrototype()Handles providers and decorators. -
validatePrototype
protected void validatePrototype()Validates required properties. -
config
-