Class ClasspathHandlerConfig.BuilderBase<BUILDER extends ClasspathHandlerConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends ClasspathHandlerConfig>
java.lang.Object
io.helidon.webserver.staticcontent.BaseHandlerConfig.BuilderBase<BUILDER, PROTOTYPE>
io.helidon.webserver.staticcontent.ClasspathHandlerConfig.BuilderBase<BUILDER, PROTOTYPE>
- 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:
ClasspathHandlerConfig.Builder
- Enclosing interface:
ClasspathHandlerConfig
public abstract static class ClasspathHandlerConfig.BuilderBase<BUILDER extends ClasspathHandlerConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends ClasspathHandlerConfig>
extends BaseHandlerConfig.BuilderBase<BUILDER, PROTOTYPE>
implements ConfigBuilderSupport.ConfiguredBuilder<BUILDER, PROTOTYPE>
Fluent API builder base for
ClasspathHandlerConfig.-
Nested Class Summary
Nested ClassesModifier 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. -
Constructor Summary
Constructors -
Method Summary
Modifier 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 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 ClasspathHandlerConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends ClasspathHandlerConfig>- Overrides:
configin classBaseHandlerConfig.BuilderBase<BUILDER extends ClasspathHandlerConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends ClasspathHandlerConfig>- Parameters:
config- configuration instance used to obtain values to update this builder- Returns:
- updated builder instance
-
location
The location on classpath that contains the root of the static content. This should never be the root (i.e./), as that would allow serving of all class files.- Parameters:
location- location on classpath to serve the static content, such as"/web".- Returns:
- updated builder instance
- See Also:
-
clearTemporaryStorage
Clear existing value of temporaryStorage.- Returns:
- updated builder instance
- See Also:
-
temporaryStorage
Customization of temporary storage configuration.- Parameters:
temporaryStorage- temporary storage config- Returns:
- updated builder instance
- See Also:
-
temporaryStorage
Customization of temporary storage configuration.- Parameters:
temporaryStorage- prototype of temporary storage config- Returns:
- updated builder instance
- See Also:
-
temporaryStorage
Customization of temporary storage configuration.- Parameters:
consumer- consumer of builder of temporary storage config- Returns:
- updated builder instance
- See Also:
-
clearClassLoader
Clear existing value of classLoader.- Returns:
- updated builder instance
- See Also:
-
classLoader
Class loader to use to lookup the static content resources from classpath.- Parameters:
classLoader- class loader to use- Returns:
- updated builder instance
- See Also:
-
clearPreCompressedCrossOriginSourcingEnabled
Clear existing value of preCompressedCrossOriginSourcingEnabled.- Returns:
- updated builder instance
- See Also:
-
preCompressedCrossOriginSourcingEnabled
public BUILDER 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.- Parameters:
preCompressedCrossOriginSourcingEnabled- whether cross-origin classpath sidecar sourcing is explicitly enabled or disabled- Returns:
- updated builder instance
- See Also:
-
singleFile
Classpath content usually starts from aClasspathHandlerConfig.location()on classpath, and resolves all requested paths against this content root. When this property is set totruewe consider thelocationto be a file, that is returned for any requested path under the configuredBaseHandlerConfigBlueprint.context().Note that when this is used, there will never be a redirect returned.
- Parameters:
singleFile- whether to considerlocationas a single file, defaults tofalse- Returns:
- updated builder instance
- See Also:
-
location
-
temporaryStorage
Customization of temporary storage configuration.- Returns:
- temporary storage config
-
classLoader
Class loader to use to lookup the static content resources from classpath.- Returns:
- class loader to use
-
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.- Returns:
- whether cross-origin classpath sidecar sourcing is explicitly enabled or disabled
-
singleFile
public boolean singleFile()Classpath content usually starts from aClasspathHandlerConfig.location()on classpath, and resolves all requested paths against this content root. When this property is set totruewe consider thelocationto be a file, that is returned for any requested path under the configuredBaseHandlerConfigBlueprint.context().Note that when this is used, there will never be a redirect returned.
- Returns:
- whether to consider
locationas a single file, defaults tofalse
-
toString
- Overrides:
toStringin classBaseHandlerConfig.BuilderBase<BUILDER extends ClasspathHandlerConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends ClasspathHandlerConfig>
-
preBuildPrototype
protected void preBuildPrototype()Handles providers and decorators.- Overrides:
preBuildPrototypein classBaseHandlerConfig.BuilderBase<BUILDER extends ClasspathHandlerConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends ClasspathHandlerConfig>
-
validatePrototype
protected void validatePrototype()Validates required properties.- Overrides:
validatePrototypein classBaseHandlerConfig.BuilderBase<BUILDER extends ClasspathHandlerConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends ClasspathHandlerConfig>
-