Interface ClasspathHandlerConfig

All Superinterfaces:
BaseHandlerConfig, Prototype.Api
All Known Implementing Classes:
ClasspathHandlerConfig.BuilderBase.ClasspathHandlerConfigImpl

public interface ClasspathHandlerConfig extends Prototype.Api, BaseHandlerConfig
Classpath based static content handler configuration.
See Also:
  • 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

      static ClasspathHandlerConfig create(Config config)
      Create a new instance from configuration.
      Parameters:
      config - used to configure the new instance
      Returns:
      a new instance configured from configuration
    • create

      @Deprecated static ClasspathHandlerConfig create(Config config)
      Create a new instance from configuration.
      Parameters:
      config - used to configure the new instance
      Returns:
      a new instance configured from configuration
    • create

      static ClasspathHandlerConfig create()
      Create a new instance with default values.
      Returns:
      a new instance
    • create

      static ClasspathHandlerConfig create(String location)
      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
    • singleFile

      boolean singleFile()
      Classpath content usually starts from a location() on classpath, and resolves all requested paths against this content root. When this property is set to true we consider the location to be a file, that is returned for any requested path under the configured BaseHandlerConfigBlueprint.context().

      Note that when this is used, there will never be a redirect returned.

      Returns:
      whether to consider location as a single file, defaults to false