Interface StaticContentConfig
- All Superinterfaces:
- Prototype.Api,- Prototype.Factory<StaticContentFeature>
- All Known Implementing Classes:
- StaticContentConfig.BuilderBase.StaticContentConfigImpl
Configuration of Static content feature.
 
Minimal example configuring a single classpath resource (properties):
server.features.static-content.classpath.0.context=/static server.features.static-content.classpath.0.location=/weband using yaml:
 server:
   features:
     static-content:
       classpath:
         - context: "/static"
           location: "/web"
 - See Also:
- 
Nested Class SummaryNested ClassesModifier and TypeInterfaceDescriptionstatic classFluent API builder forStaticContentFeature.static classStaticContentConfig.BuilderBase<BUILDER extends StaticContentConfig.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends StaticContentConfig> Fluent API builder base forStaticContentFeature.
- 
Method SummaryModifier and TypeMethodDescriptionstatic StaticContentConfig.Builderbuilder()Create a new fluent API builder to customize configuration.static StaticContentConfig.Builderbuilder(StaticContentConfig instance) Create a new fluent API builder from an existing instance.List of classpath based static content handlers.Maps a filename extension to the response content type.static StaticContentConfigcreate()Create a new instance with default values.static StaticContentConfigDeprecated.static StaticContentConfigCreate a new instance from configuration.booleanenabled()Whether this feature is enabled, defaults totrue.Memory cache shared by the whole feature.name()Name of this instance.path()List of file system based static content handlers.sockets()Sockets names (listeners) that will host static content handlers, defaults to all configured sockets.Temporary storage to use across all classpath handlers.doubleweight()Weight of the static content feature.welcome()Welcome-file name.Methods inherited from interface io.helidon.builder.api.Prototype.Factorybuild
- 
Method Details- 
builderCreate a new fluent API builder to customize configuration.- Returns:
- a new builder
 
- 
builderCreate 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
 
- 
createCreate a new instance from configuration.- Parameters:
- config- used to configure the new instance
- Returns:
- a new instance configured from configuration
 
- 
createDeprecated.Create a new instance from configuration.- Parameters:
- config- used to configure the new instance
- Returns:
- a new instance configured from configuration
 
- 
createCreate a new instance with default values.- Returns:
- a new instance
 
- 
enabledboolean enabled()Whether this feature is enabled, defaults totrue.- Returns:
- whether this feature is enabled
 
- 
weightdouble weight()Weight of the static content feature. Defaults to 95.0.- Returns:
- weight of the feature
 
- 
nameString name()Name of this instance.- Returns:
- instance name
 
- 
memoryCacheOptional<MemoryCache> memoryCache()Memory cache shared by the whole feature. If not configured, files are not cached in memory (except for explicitly marked files/resources in each section).- Returns:
- memory cache, if configured
 
- 
temporaryStorageOptional<TemporaryStorage> temporaryStorage()Temporary storage to use across all classpath handlers. If not defined, a default one will be created.- Returns:
- temporary storage
 
- 
classpathList<ClasspathHandlerConfig> classpath()List of classpath based static content handlers.- Returns:
- classpath handlers
 
- 
pathList<FileSystemHandlerConfig> path()List of file system based static content handlers.- Returns:
- path handlers
 
- 
contentTypesMaps a filename extension to the response content type. To have a system-wide configuration, you can use the service loader SPIMediaTypeDetector.This method can override MediaTypesdetection for a specific static content handler.Handler will use a union of configuration defined here, and on the handler here when used from configuration. - Returns:
- map of file extensions to associated media type
 
- 
welcomeWelcome-file name. Default for all handlers. By default, we do not serve default files.- Returns:
- welcome-file name, such as index.html
 
- 
socketsSockets names (listeners) that will host static content handlers, defaults to all configured sockets. Default socket name is@default.This configures defaults for all handlers. - Returns:
- sockets to register this handler on
 
 
- 
create(io.helidon.config.Config)