Class ClasspathHandlerConfig.BuilderBase<BUILDER extends ClasspathHandlerConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends ClasspathHandlerConfig>

java.lang.Object
io.helidon.webserver.staticcontent.BaseHandlerConfig.BuilderBase<BUILDER, PROTOTYPE>
io.helidon.webserver.staticcontent.ClasspathHandlerConfig.BuilderBase<BUILDER, PROTOTYPE>
Type Parameters:
BUILDER - type of the builder extending this abstract builder
PROTOTYPE - type of the prototype interface that would be built by Prototype.Builder.buildPrototype()
All Implemented Interfaces:
Prototype.Builder<BUILDER, PROTOTYPE>, ConfigBuilderSupport.ConfiguredBuilder<BUILDER, PROTOTYPE>
Direct Known Subclasses:
ClasspathHandlerConfig.Builder
Enclosing interface:
ClasspathHandlerConfig

public abstract static class ClasspathHandlerConfig.BuilderBase<BUILDER extends ClasspathHandlerConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends ClasspathHandlerConfig> extends BaseHandlerConfig.BuilderBase<BUILDER, PROTOTYPE> implements ConfigBuilderSupport.ConfiguredBuilder<BUILDER, PROTOTYPE>
Fluent API builder base for ClasspathHandlerConfig.
  • Constructor Details

    • BuilderBase

      protected BuilderBase()
      Protected to support extensibility.
  • Method Details

    • from

      public BUILDER from(ClasspathHandlerConfig prototype)
      Update this builder from an existing prototype instance. This method disables automatic service discovery.
      Parameters:
      prototype - existing prototype to update this builder from
      Returns:
      updated builder instance
    • from

      public BUILDER from(ClasspathHandlerConfig.BuilderBase<?,?> builder)
      Update this builder from an existing prototype builder instance.
      Parameters:
      builder - existing builder prototype to update this builder from
      Returns:
      updated builder instance
    • config

      public BUILDER config(Config config)
      Update builder from configuration (node of this type). If a value is present in configuration, it would override currently configured values.
      Specified by:
      config in interface ConfigBuilderSupport.ConfiguredBuilder<BUILDER extends ClasspathHandlerConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends ClasspathHandlerConfig>
      Overrides:
      config in class BaseHandlerConfig.BuilderBase<BUILDER extends ClasspathHandlerConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends ClasspathHandlerConfig>
      Parameters:
      config - configuration instance used to obtain values to update this builder
      Returns:
      updated builder instance
    • location

      public BUILDER 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.
      Parameters:
      location - location on classpath to serve the static content, such as "/web".
      Returns:
      updated builder instance
      See Also:
    • clearTemporaryStorage

      public BUILDER clearTemporaryStorage()
      Clear existing value of temporaryStorage.
      Returns:
      updated builder instance
      See Also:
    • temporaryStorage

      public BUILDER temporaryStorage(TemporaryStorage temporaryStorage)
      Customization of temporary storage configuration.
      Parameters:
      temporaryStorage - temporary storage config
      Returns:
      updated builder instance
      See Also:
    • temporaryStorage

      public BUILDER temporaryStorage(TemporaryStorageConfig temporaryStorage)
      Customization of temporary storage configuration.
      Parameters:
      temporaryStorage - prototype of temporary storage config
      Returns:
      updated builder instance
      See Also:
    • temporaryStorage

      public BUILDER temporaryStorage(Consumer<TemporaryStorageConfig.Builder> consumer)
      Customization of temporary storage configuration.
      Parameters:
      consumer - consumer of builder of temporary storage config
      Returns:
      updated builder instance
      See Also:
    • clearClassLoader

      public BUILDER clearClassLoader()
      Clear existing value of classLoader.
      Returns:
      updated builder instance
      See Also:
    • classLoader

      public BUILDER classLoader(ClassLoader classLoader)
      Class loader to use to lookup the static content resources from classpath.
      Parameters:
      classLoader - class loader to use
      Returns:
      updated builder instance
      See Also:
    • clearPreCompressedCrossOriginSourcingEnabled

      public BUILDER clearPreCompressedCrossOriginSourcingEnabled()
      Clear existing value of preCompressedCrossOriginSourcingEnabled.
      Returns:
      updated builder instance
      See Also:
    • preCompressedCrossOriginSourcingEnabled

      public BUILDER preCompressedCrossOriginSourcingEnabled(boolean preCompressedCrossOriginSourcingEnabled)
      Whether sidecar resources may be sourced from a different classpath origin than the logical resource; when not configured, feature-registered handlers inherit the feature-level value and direct services default to false.
      Parameters:
      preCompressedCrossOriginSourcingEnabled - whether cross-origin classpath sidecar sourcing is explicitly enabled or disabled
      Returns:
      updated builder instance
      See Also:
    • singleFile

      public BUILDER singleFile(boolean singleFile)
      Classpath content usually starts from a ClasspathHandlerConfig.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.

      Parameters:
      singleFile - whether to consider location as a single file, defaults to false
      Returns:
      updated builder instance
      See Also:
    • location

      public Optional<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

      public Optional<TemporaryStorage> temporaryStorage()
      Customization of temporary storage configuration.
      Returns:
      temporary storage config
    • classLoader

      public Optional<ClassLoader> classLoader()
      Class loader to use to lookup the static content resources from classpath.
      Returns:
      class loader to use
    • preCompressedCrossOriginSourcingEnabled

      public Optional<Boolean> preCompressedCrossOriginSourcingEnabled()
      Whether sidecar resources may be sourced from a different classpath origin than the logical resource; when not configured, feature-registered handlers inherit the feature-level value and direct services default to false.
      Returns:
      whether cross-origin classpath sidecar sourcing is explicitly enabled or disabled
    • singleFile

      public boolean singleFile()
      Classpath content usually starts from a ClasspathHandlerConfig.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
    • toString

    • preBuildPrototype

      protected void preBuildPrototype()
      Handles providers and decorators.
      Overrides:
      preBuildPrototype in class BaseHandlerConfig.BuilderBase<BUILDER extends ClasspathHandlerConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends ClasspathHandlerConfig>
    • validatePrototype

      protected void validatePrototype()
      Validates required properties.
      Overrides:
      validatePrototype in class BaseHandlerConfig.BuilderBase<BUILDER extends ClasspathHandlerConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends ClasspathHandlerConfig>