Class ClasspathHandlerConfig.Builder
java.lang.Object
io.helidon.webserver.staticcontent.BaseHandlerConfig.BuilderBase<ClasspathHandlerConfig.Builder, ClasspathHandlerConfig>
io.helidon.webserver.staticcontent.ClasspathHandlerConfig.BuilderBase<ClasspathHandlerConfig.Builder, ClasspathHandlerConfig>
io.helidon.webserver.staticcontent.ClasspathHandlerConfig.Builder
- All Implemented Interfaces:
Prototype.Builder<ClasspathHandlerConfig.Builder, ClasspathHandlerConfig>, Builder<ClasspathHandlerConfig.Builder, ClasspathHandlerConfig>, ConfigBuilderSupport.ConfiguredBuilder<ClasspathHandlerConfig.Builder, ClasspathHandlerConfig>, Supplier<ClasspathHandlerConfig>
- Enclosing interface:
ClasspathHandlerConfig
public static class ClasspathHandlerConfig.Builder
extends ClasspathHandlerConfig.BuilderBase<ClasspathHandlerConfig.Builder, ClasspathHandlerConfig>
implements Builder<ClasspathHandlerConfig.Builder, ClasspathHandlerConfig>
Fluent API builder for
ClasspathHandlerConfig.-
Nested Class Summary
Nested classes/interfaces inherited from class ClasspathHandlerConfig.BuilderBase
ClasspathHandlerConfig.BuilderBase.ClasspathHandlerConfigImplModifier 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 ClasspathHandlerConfig.BuilderBase
classLoader, classLoader, clearClassLoader, clearPreCompressedCrossOriginSourcingEnabled, clearTemporaryStorage, config, from, from, location, location, preBuildPrototype, preCompressedCrossOriginSourcingEnabled, preCompressedCrossOriginSourcingEnabled, singleFile, singleFile, temporaryStorage, temporaryStorage, temporaryStorage, temporaryStorage, toString, validatePrototypeModifier and TypeMethodDescriptionClass loader to use to lookup the static content resources from classpath.classLoader(ClassLoader classLoader) Class loader to use to lookup the static content resources from classpath.Clear existing value of classLoader.Clear existing value of preCompressedCrossOriginSourcingEnabled.Clear existing value of temporaryStorage.Update builder from configuration (node of this type).from(ClasspathHandlerConfig prototype) Update this builder from an existing prototype instance.from(ClasspathHandlerConfig.BuilderBase<?, ?> builder) Update this builder from an existing prototype builder instance.location()The location on classpath that contains the root of the static content.The location on classpath that contains the root of the static content.protected voidHandles providers and decorators.Whether sidecar resources may be sourced from a different classpath origin than the logical resource; when not configured, feature-registered handlers inherit the feature-level value and direct services default tofalse.preCompressedCrossOriginSourcingEnabled(boolean preCompressedCrossOriginSourcingEnabled) Whether sidecar resources may be sourced from a different classpath origin than the logical resource; when not configured, feature-registered handlers inherit the feature-level value and direct services default tofalse.booleanClasspath content usually starts from aClasspathHandlerConfig.location()on classpath, and resolves all requested paths against this content root.singleFile(boolean singleFile) Classpath content usually starts from aClasspathHandlerConfig.location()on classpath, and resolves all requested paths against this content root.Customization of temporary storage configuration.temporaryStorage(TemporaryStorage temporaryStorage) Customization of temporary storage configuration.temporaryStorage(TemporaryStorageConfig temporaryStorage) Customization of temporary storage configuration.Customization of temporary storage configuration.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 ClasspathHandlerConfigget()default ClasspathHandlerConfig.Builderidentity()Instance of this builder as the correct type.default ClasspathHandlerConfig.Builderupdate(Consumer<ClasspathHandlerConfig.Builder> consumer) Update the builder in a fluent API way.Methods inherited from interface Prototype.Builder
selfModifier and TypeMethodDescriptiondefault ClasspathHandlerConfig.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<ClasspathHandlerConfig.Builder, ClasspathHandlerConfig>- 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<ClasspathHandlerConfig.Builder, ClasspathHandlerConfig>- Returns:
- instance of the built type
-