Class StaticContentConfig.BuilderBase.StaticContentConfigImpl

java.lang.Object
io.helidon.webserver.staticcontent.StaticContentConfig.BuilderBase.StaticContentConfigImpl
All Implemented Interfaces:
Prototype.Api, Prototype.Factory<StaticContentFeature>, StaticContentConfig, Supplier<StaticContentFeature>
Enclosing class:
StaticContentConfig.BuilderBase<BUILDER extends StaticContentConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends StaticContentConfig>

protected static class StaticContentConfig.BuilderBase.StaticContentConfigImpl extends Object implements StaticContentConfig, Supplier<StaticContentFeature>
Generated implementation of the prototype, can be extended by descendant prototype implementations.
  • Constructor Details

    • StaticContentConfigImpl

      protected StaticContentConfigImpl(StaticContentConfig.BuilderBase<?,?> builder)
      Create an instance providing a builder.
      Parameters:
      builder - extending builder base of this prototype
  • Method Details

    • build

      public StaticContentFeature build()
      Create a new runtime instance from this prototype.
      Specified by:
      build in interface Prototype.Factory<StaticContentFeature>
      Returns:
      new configured runtime instance
    • get

      public StaticContentFeature get()
      Specified by:
      get in interface Supplier<StaticContentFeature>
    • enabled

      public boolean enabled()
      Description copied from interface: StaticContentConfig
      Whether this feature is enabled, defaults to true.
      Specified by:
      enabled in interface StaticContentConfig
      Returns:
      whether this feature is enabled
    • weight

      public double weight()
      Description copied from interface: StaticContentConfig
      Weight of the static content feature. Defaults to 95.0.
      Specified by:
      weight in interface StaticContentConfig
      Returns:
      weight of the feature
    • name

      public String name()
      Description copied from interface: StaticContentConfig
      Name of this instance.
      Specified by:
      name in interface StaticContentConfig
      Returns:
      instance name
    • memoryCache

      public Optional<MemoryCache> memoryCache()
      Description copied from interface: StaticContentConfig
      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).
      Specified by:
      memoryCache in interface StaticContentConfig
      Returns:
      memory cache, if configured
    • temporaryStorage

      public Optional<TemporaryStorage> temporaryStorage()
      Description copied from interface: StaticContentConfig
      Temporary storage to use across all classpath handlers. If not defined, a default one will be created.
      Specified by:
      temporaryStorage in interface StaticContentConfig
      Returns:
      temporary storage
    • classpath

      public List<ClasspathHandlerConfig> classpath()
      Description copied from interface: StaticContentConfig
      List of classpath based static content handlers.
      Specified by:
      classpath in interface StaticContentConfig
      Returns:
      classpath handlers
    • path

      public List<FileSystemHandlerConfig> path()
      Description copied from interface: StaticContentConfig
      List of file system based static content handlers.
      Specified by:
      path in interface StaticContentConfig
      Returns:
      path handlers
    • contentTypes

      public Map<String, MediaType> contentTypes()
      Description copied from interface: StaticContentConfig
      Maps a filename extension to the response content type. To have a system-wide configuration, you can use the service loader SPI MediaTypeDetector.

      This method can override MediaTypes detection for a specific static content handler.

      Handler will use a union of configuration defined here, and on the handler here when used from configuration.

      Specified by:
      contentTypes in interface StaticContentConfig
      Returns:
      map of file extensions to associated media type
    • welcome

      public Optional<String> welcome()
      Description copied from interface: StaticContentConfig
      Welcome-file name. Default for all handlers. By default, we do not serve default files.
      Specified by:
      welcome in interface StaticContentConfig
      Returns:
      welcome-file name, such as index.html
    • sockets

      public Set<String> sockets()
      Description copied from interface: StaticContentConfig
      Sockets names (listeners) that will host static content handlers, defaults to all configured sockets. Default socket name is @default.

      This configures defaults for all handlers.

      Specified by:
      sockets in interface StaticContentConfig
      Returns:
      sockets to register this handler on
    • preCompressedEnabled

      public boolean preCompressedEnabled()
      Description copied from interface: StaticContentConfig
      Whether pre-compressed sidecar resources should be selected by default for feature-registered directory and classpath handlers; this is disabled by default and does not apply to file system handlers configured with a single file, which require handler-level opt-in.
      Specified by:
      preCompressedEnabled in interface StaticContentConfig
      Returns:
      whether pre-compressed sidecar resources should be used
    • preCompressedCrossOriginSourcingEnabled

      public boolean preCompressedCrossOriginSourcingEnabled()
      Description copied from interface: StaticContentConfig
      Whether classpath sidecar resources may be sourced from a different classpath origin than the logical resource by default for feature-registered handlers.
      Specified by:
      preCompressedCrossOriginSourcingEnabled in interface StaticContentConfig
      Returns:
      whether cross-origin classpath sidecar sourcing is enabled by default
    • preCompressedEncodings

      public Map<String,String> preCompressedEncodings()
      Description copied from interface: StaticContentConfig
      Pre-compressed content coding to file suffix mappings; defaults include br to br and gzip to gz, handler-level mappings replace these mappings rather than merging with them, an explicit empty map disables sidecar lookups by default, codings must be unique concrete valid HTTP tokens other than identity and *, and suffixes have leading dots ignored and must not contain path separators.
      Specified by:
      preCompressedEncodings in interface StaticContentConfig
      Returns:
      content coding to file suffix mappings
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object