Class FileSystemHandlerConfig.Builder
java.lang.Object
io.helidon.webserver.staticcontent.BaseHandlerConfig.BuilderBase<FileSystemHandlerConfig.Builder, FileSystemHandlerConfig>
io.helidon.webserver.staticcontent.FileSystemHandlerConfig.BuilderBase<FileSystemHandlerConfig.Builder, FileSystemHandlerConfig>
io.helidon.webserver.staticcontent.FileSystemHandlerConfig.Builder
- All Implemented Interfaces:
Prototype.Builder<FileSystemHandlerConfig.Builder, FileSystemHandlerConfig>, Builder<FileSystemHandlerConfig.Builder, FileSystemHandlerConfig>, ConfigBuilderSupport.ConfiguredBuilder<FileSystemHandlerConfig.Builder, FileSystemHandlerConfig>, Supplier<FileSystemHandlerConfig>
- Enclosing interface:
FileSystemHandlerConfig
public static class FileSystemHandlerConfig.Builder
extends FileSystemHandlerConfig.BuilderBase<FileSystemHandlerConfig.Builder, FileSystemHandlerConfig>
implements Builder<FileSystemHandlerConfig.Builder, FileSystemHandlerConfig>
Fluent API builder for
FileSystemHandlerConfig.-
Nested Class Summary
Nested classes/interfaces inherited from class FileSystemHandlerConfig.BuilderBase
FileSystemHandlerConfig.BuilderBase.FileSystemHandlerConfigImplModifier and TypeClassDescriptionprotected static classGenerated implementation of the prototype, can be extended by descendant prototype implementations.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 FileSystemHandlerConfig.BuilderBase
config, from, from, location, location, preBuildPrototype, toString, validatePrototypeModifier and TypeMethodDescriptionUpdate builder from configuration (node of this type).from(FileSystemHandlerConfig prototype) Update this builder from an existing prototype instance.from(FileSystemHandlerConfig.BuilderBase<?, ?> builder) Update this builder from an existing prototype builder instance.location()The directory (or a single file) that contains the root of the static content.The directory (or a single file) that contains the root of the static content.protected voidHandles providers and decorators.toString()protected voidValidates required properties.Methods inherited from class BaseHandlerConfig.BuilderBase
addCachedFile, addCachedFiles, addContentTypes, addPreCompressedEncodings, addSocket, addSockets, cachedFiles, cachedFiles, clearCachedFiles, clearMemoryCache, clearPreCompressedEnabled, clearPreCompressedEncodings, clearRecordCacheCapacity, clearSockets, clearWelcome, config, contentTypes, contentTypes, context, context, enabled, enabled, from, from, memoryCache, memoryCache, memoryCache, memoryCache, pathMapper, pathMapper, preCompressedEnabled, preCompressedEnabled, preCompressedEncodings, preCompressedEncodings, putContentType, putPreCompressedEncoding, recordCacheCapacity, recordCacheCapacity, sockets, sockets, 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.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.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.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 FileSystemHandlerConfigget()default FileSystemHandlerConfig.Builderidentity()Instance of this builder as the correct type.default FileSystemHandlerConfig.Builderupdate(Consumer<FileSystemHandlerConfig.Builder> consumer) Update the builder in a fluent API way.Methods inherited from interface Prototype.Builder
selfModifier and TypeMethodDescriptiondefault FileSystemHandlerConfig.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<FileSystemHandlerConfig.Builder, FileSystemHandlerConfig>- 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<FileSystemHandlerConfig.Builder, FileSystemHandlerConfig>- Returns:
- instance of the built type
-