@EachProperty(value="micronaut.router.static-resources") public class StaticResourceConfiguration extends java.lang.Object implements Toggleable
Modifier and Type | Field and Description |
---|---|
static boolean |
DEFAULT_ENABLED
The default enable value.
|
static java.lang.String |
DEFAULT_MAPPING
The default mapping value.
|
static java.lang.String |
PREFIX
The prefix for static resources configuration.
|
Constructor and Description |
---|
StaticResourceConfiguration(ResourceResolver resourceResolver,
ServerContextPathProvider contextPathProvider) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getMapping()
The static resource mapping.
|
java.util.List<ResourceLoader> |
getResourceLoaders() |
boolean |
isEnabled() |
void |
setEnabled(boolean enabled)
Sets whether this specific mapping is enabled.
|
void |
setMapping(java.lang.String mapping)
The path resources should be served from.
|
void |
setPaths(java.util.List<java.lang.String> paths)
A list of paths either starting with `classpath:` or `file:`.
|
public static final java.lang.String PREFIX
public static final boolean DEFAULT_ENABLED
public static final java.lang.String DEFAULT_MAPPING
@Inject public StaticResourceConfiguration(ResourceResolver resourceResolver, @Nullable ServerContextPathProvider contextPathProvider)
resourceResolver
- The ResourceResolvercontextPathProvider
- The context path providerpublic boolean isEnabled()
isEnabled
in interface Toggleable
public java.util.List<ResourceLoader> getResourceLoaders()
ResourceLoader
available for the pathpublic java.lang.String getMapping()
public void setEnabled(boolean enabled)
enabled
- True if they are enabled.public void setPaths(java.util.List<java.lang.String> paths)
paths
- The pathspublic void setMapping(java.lang.String mapping)
mapping
- The mapping