Interface ClasspathHandlerConfig
- All Superinterfaces:
BaseHandlerConfig, Prototype.Api
- All Known Implementing Classes:
ClasspathHandlerConfig.BuilderBase.ClasspathHandlerConfigImpl
Classpath based static content handler configuration.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classFluent API builder forClasspathHandlerConfig.static classClasspathHandlerConfig.BuilderBase<BUILDER extends ClasspathHandlerConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends ClasspathHandlerConfig>Fluent API builder base forClasspathHandlerConfig. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Create a new fluent API builder to customize configuration.builder(ClasspathHandlerConfig instance) Create a new fluent API builder from an existing instance.Class loader to use to lookup the static content resources from classpath.static ClasspathHandlerConfigCreate a new instance from configuration.static ClasspathHandlerConfigCreate a new classpath based static content configuration from the defined location.location()The location on classpath that contains the root of the static content.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 alocation()on classpath, and resolves all requested paths against this content root.Customization of temporary storage configuration.Methods inherited from interface BaseHandlerConfig
cachedFiles, contentTypes, context, enabled, memoryCache, pathMapper, preCompressedEnabled, preCompressedEncodings, recordCacheCapacity, sockets, welcomeModifier and TypeMethodDescriptionA set of files that are cached in memory at startup.Maps a filename extension to the response content type.context()Context that will serve this handler's static resources, defaults to/.booleanenabled()Whether this handle is enabled, defaults totrue.Handles will use memory cache configured onStaticContentConfig.memoryCache()by default.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.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.sockets()Sockets names (listeners) that will host this static content handler, defaults to all configured sockets.welcome()Welcome-file name.
-
Method Details
-
builder
Create a new fluent API builder to customize configuration.- Returns:
- a new builder
-
builder
Create a new fluent API builder from an existing instance.- Parameters:
instance- an existing instance used as a base for the builder- Returns:
- a builder based on an instance
-
create
Create a new instance from configuration.- Parameters:
config- used to configure the new instance- Returns:
- a new instance configured from configuration
-
create
Create a new classpath based static content configuration from the defined location. All other configuration is default.- Parameters:
location- location on classpath- Returns:
- a new configuration for classpath static content handler
-
location
String 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.- Returns:
- location on classpath to serve the static content, such as
"/web".
-
temporaryStorage
Optional<TemporaryStorage> temporaryStorage()Customization of temporary storage configuration.- Returns:
- temporary storage config
-
classLoader
Optional<ClassLoader> 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
boolean singleFile()Classpath content usually starts from alocation()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
-