Class StaticContentService.Builder<B extends StaticContentService.Builder<B>>

java.lang.Object
io.helidon.webserver.staticcontent.StaticContentService.Builder<B>
Type Parameters:
B - type of a subclass of a concrete builder
All Implemented Interfaces:
Builder<B,StaticContentService>, Supplier<StaticContentService>
Direct Known Subclasses:
StaticContentService.FileBasedBuilder
Enclosing interface:
StaticContentService

@Deprecated(forRemoval=true, since="4.1.5") public abstract static class StaticContentService.Builder<B extends StaticContentService.Builder<B>> extends Object implements Builder<B,StaticContentService>
Deprecated, for removal: This API element is subject to removal in a future version.
Fluent builder of the StaticContent detailed parameters.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Deprecated, for removal: This API element is subject to removal in a future version.
    Default constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
    Add a path (as requested by the user) that should be cached in memory.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Build the instance from this builder.
    protected abstract StaticContentService
    Deprecated, for removal: This API element is subject to removal in a future version.
    Build the actual instance.
    pathMapper(Function<String,String> resolvePathFunction)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Map request path to resource path.
    recordCacheCapacity(int capacity)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Configure capacity of cache used for resources.
    welcomeFileName(String welcomeFileName)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Sets a name of the "file" which will be returned if directory is requested.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface io.helidon.common.Builder

    get, identity, update
  • Constructor Details

    • Builder

      protected Builder()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Default constructor.
  • Method Details

    • build

      public final StaticContentService build()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: Builder
      Build the instance from this builder.
      Specified by:
      build in interface Builder<B extends StaticContentService.Builder<B>,StaticContentService>
      Returns:
      instance of the built type
    • welcomeFileName

      public B welcomeFileName(String welcomeFileName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets a name of the "file" which will be returned if directory is requested.
      Parameters:
      welcomeFileName - a name of the welcome file
      Returns:
      updated builder
    • pathMapper

      public B pathMapper(Function<String,String> resolvePathFunction)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Map request path to resource path. Default uses the same path as requested. This can be used to resolve all paths to a single file, or to filter out files.
      Parameters:
      resolvePathFunction - function
      Returns:
      updated builder
    • addCacheInMemory

      public B addCacheInMemory(String path)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Add a path (as requested by the user) that should be cached in memory. The resource will be loaded into memory (as bytes) on server startup and served from memory, instead of accessing the resource each time. For classpath, each file must be explicitly specified (as we do not scan classpath), for file based this can also include directories. Helidon does not validate amount of memory used, be careful to have enough heap memory to cache the configured files.

      Files cached in memory will never be re-loaded, even if changed, until server restart!

      For classpath resource served from web/index.html, the path should be configured to index.html when the classpath root is set to web.

      Parameters:
      path - path to cache in memory
      Returns:
      updated builder
    • recordCacheCapacity

      public B recordCacheCapacity(int capacity)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Configure capacity of cache used for resources. This cache will make sure the media type and location is discovered faster.
      Parameters:
      capacity - maximal number of cached records, only caches media type and Path, not the content
      Returns:
      updated builder
    • doBuild

      protected abstract StaticContentService doBuild()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Build the actual instance.
      Returns:
      static content support