Class StaticResourceConfiguration

java.lang.Object
io.micronaut.web.router.resource.StaticResourceConfiguration
All Implemented Interfaces:
Toggleable

@EachProperty("micronaut.router.static-resources") public class StaticResourceConfiguration extends Object implements Toggleable
Stores configuration for the loading of static resources.
Since:
1.0
Author:
James Kleeh
  • Field Details

  • Constructor Details

  • Method Details

    • isEnabled

      public boolean isEnabled()
      Specified by:
      isEnabled in interface Toggleable
      Returns:
      Enable the static resources router
    • getResourceLoaders

      public List<ResourceLoader> getResourceLoaders()
      Returns:
      The list of ResourceLoader available for the path
    • getMapping

      public String getMapping()
      The static resource mapping.
      Returns:
      The mapping
    • setEnabled

      public void setEnabled(boolean enabled)
      Sets whether this specific mapping is enabled. Default value (true).
      Parameters:
      enabled - True if they are enabled.
    • setPaths

      public void setPaths(List<String> paths)
      A list of paths either starting with `classpath:` or `file:`. You can serve files from anywhere on disk or the classpath. For example to serve static resources from `src/main/resources/public`, you would use `classpath:public` as the path.
      Parameters:
      paths - The paths
    • setMapping

      public void setMapping(String mapping)
      The path resources should be served from. Uses ant path matching. Default value ("/**").
      Parameters:
      mapping - The mapping