Class BaseHandlerConfig.Builder
java.lang.Object
io.helidon.webserver.staticcontent.BaseHandlerConfig.BuilderBase<BaseHandlerConfig.Builder, BaseHandlerConfig>
io.helidon.webserver.staticcontent.BaseHandlerConfig.Builder
- All Implemented Interfaces:
Prototype.Builder<BaseHandlerConfig.Builder, BaseHandlerConfig>, Builder<BaseHandlerConfig.Builder, BaseHandlerConfig>, ConfigBuilderSupport.ConfiguredBuilder<BaseHandlerConfig.Builder, BaseHandlerConfig>, Supplier<BaseHandlerConfig>
- Enclosing interface:
BaseHandlerConfig
public static class BaseHandlerConfig.Builder
extends BaseHandlerConfig.BuilderBase<BaseHandlerConfig.Builder, BaseHandlerConfig>
implements Builder<BaseHandlerConfig.Builder, BaseHandlerConfig>
Fluent API builder for
BaseHandlerConfig.-
Nested Class Summary
Nested classes/interfaces inherited from class BaseHandlerConfig.BuilderBase
BaseHandlerConfig.BuilderBase.BaseHandlerConfigImplModifier and TypeClassDescriptionprotected static classGenerated implementation of the prototype, can be extended by descendant prototype implementations. -
Method Summary
Modifier and TypeMethodDescriptionbuild()Create an instance from this builder.Create an instance of the prototype.Methods inherited from class BaseHandlerConfig.BuilderBase
addCachedFile, addCachedFiles, addContentTypes, addPreCompressedEncodings, addSocket, addSockets, cachedFiles, cachedFiles, clearCachedFiles, clearMemoryCache, clearPreCompressedEnabled, clearPreCompressedEncodings, clearRecordCacheCapacity, clearSockets, clearWelcome, config, config, contentTypes, contentTypes, context, context, enabled, enabled, from, from, memoryCache, memoryCache, memoryCache, memoryCache, pathMapper, pathMapper, preBuildPrototype, preCompressedEnabled, preCompressedEnabled, preCompressedEncodings, preCompressedEncodings, putContentType, putPreCompressedEncoding, recordCacheCapacity, recordCacheCapacity, sockets, sockets, toString, validatePrototype, welcome, welcomeModifier and TypeMethodDescriptionaddCachedFile(String cachedFile) A set of files that are cached in memory at startup.addCachedFiles(Set<String> cachedFiles) A set of files that are cached in memory at startup.addContentTypes(Map<String, ? extends MediaType> contentTypes) Maps a filename extension to the response content type.addPreCompressedEncodings(Map<String, String> preCompressedEncodings) Pre-compressed content coding to file suffix mappings; handler mappings replace inherited feature-level mappings rather than merging with them, an explicit empty map disables sidecar lookups for this handler, 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 this static content handler, defaults to all configured sockets.addSockets(Set<String> sockets) Sockets names (listeners) that will host this static content handler, defaults to all configured sockets.A set of files that are cached in memory at startup.cachedFiles(Set<String> cachedFiles) A set of files that are cached in memory at startup.Clear all cachedFiles.Clear existing value of memoryCache.Clear existing value of preCompressedEnabled.Clear existing value of preCompressedEncodings.Clear existing value of recordCacheCapacity.Clear all sockets.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.context()Context that will serve this handler's static resources, defaults to/.Context that will serve this handler's static resources, defaults to/.booleanenabled()Whether this handle is enabled, defaults totrue.enabled(boolean enabled) Whether this handle is enabled, defaults totrue.from(BaseHandlerConfig prototype) Update this builder from an existing prototype instance.from(BaseHandlerConfig.BuilderBase<?, ?> builder) Update this builder from an existing prototype builder instance.Handles will use memory cache configured onStaticContentConfig.memoryCache()by default.memoryCache(MemoryCache memoryCache) Handles will use memory cache configured onStaticContentConfig.memoryCache()by default.memoryCache(MemoryCacheConfig memoryCache) Handles will use memory cache configured onStaticContentConfig.memoryCache()by default.memoryCache(Consumer<MemoryCacheConfig.Builder> consumer) Handles will use memory cache configured onStaticContentConfig.memoryCache()by default.Map request path to resource path.pathMapper(Function<String, String> pathMapper) Map request path to resource path.protected voidHandles providers and decorators.Whether pre-compressed sidecar resources should be selected for this handler; feature-registered handlers inherit the feature value when absent, directly created handlers default to disabled, and file system handlers configured with a single file always require handler-level opt-in.preCompressedEnabled(boolean preCompressedEnabled) Whether pre-compressed sidecar resources should be selected for this handler; feature-registered handlers inherit the feature value when absent, directly created handlers default to disabled, and file system handlers configured with a single file always require handler-level opt-in.Pre-compressed content coding to file suffix mappings; handler mappings replace inherited feature-level mappings rather than merging with them, an explicit empty map disables sidecar lookups for this handler, 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; handler mappings replace inherited feature-level mappings rather than merging with them, an explicit empty map disables sidecar lookups for this handler, 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; handler mappings replace inherited feature-level mappings rather than merging with them, an explicit empty map disables sidecar lookups for this handler, codings must be unique concrete valid HTTP tokens other thanidentityand*, and suffixes have leading dots ignored and must not contain path separators.Configures the capacity of the cache used for resource metadata.recordCacheCapacity(int recordCacheCapacity) Configures the capacity of the cache used for resource metadata.sockets()Sockets names (listeners) that will host this static content handler, defaults to all configured sockets.Sockets names (listeners) that will host this static content handler, defaults to all configured sockets.toString()protected voidValidates required properties.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 Builder
get, identity, updateModifier and TypeMethodDescriptiondefault BaseHandlerConfigget()default BaseHandlerConfig.Builderidentity()Instance of this builder as the correct type.default BaseHandlerConfig.Builderupdate(Consumer<BaseHandlerConfig.Builder> consumer) Update the builder in a fluent API way.Methods inherited from interface Prototype.Builder
selfModifier and TypeMethodDescriptiondefault BaseHandlerConfig.Builderself()Instance of this builder as the correct type.
-
Method Details
-
buildPrototype
Create an instance of the prototype. Calling this method may update this builder from providers and decorators, so repeated calls may have side effects.- Specified by:
buildPrototypein interfacePrototype.Builder<BaseHandlerConfig.Builder, BaseHandlerConfig>- Returns:
- an instance of the setup object created from this builder
-
build
Create an instance from this builder. Calling this method may update this builder from providers and decorators, so repeated calls may have side effects.- Specified by:
buildin interfaceBuilder<BaseHandlerConfig.Builder, BaseHandlerConfig>- Returns:
- instance of the built type
-