Interface ResourceConfig

All Superinterfaces:
Prototype.Api, Prototype.Factory<Resource>
All Known Implementing Classes:
ResourceConfig.BuilderBase.ResourceConfigImpl

public interface ResourceConfig extends Prototype.Api
Configuration of a resource.
See Also:
  • Method Details

    • builder

      static ResourceConfig.Builder builder()
      Create a new fluent API builder to customize configuration.
      Returns:
      a new builder
    • builder

      static ResourceConfig.Builder builder(ResourceConfig instance)
      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 ResourceConfig create(Config config)
      Create a new instance from configuration.
      Parameters:
      config - used to configure the new instance
      Returns:
      a new instance configured from configuration
    • resourcePath

      Optional<String> resourcePath()
      Resource is located on classpath.
      Returns:
      classpath location of the resource
    • path

      Optional<Path> path()
      Resource is located on filesystem.
      Returns:
      path of the resource
    • contentPlain

      Optional<String> contentPlain()
      Plain content of the resource (text).
      Returns:
      plain content
    • content

      Optional<String> content()
      Binary content of the resource (base64 encoded).
      Returns:
      binary content
    • uri

      Optional<URI> uri()
      Resource is available on a URI.
      Returns:
      of the resource
      See Also:
    • proxyHost

      Optional<String> proxyHost()
      Host of the proxy when using URI.
      Returns:
      proxy host
    • proxyPort

      int proxyPort()
      Port of the proxy when using URI.
      Returns:
      proxy port
    • useProxy

      boolean useProxy()
      Whether to use proxy. If set to false, proxy will not be used even if configured. When set to true (default), proxy will be used if configured.
      Returns:
      whether to use proxy if configured
    • proxy

      Optional<Proxy> proxy()
      Proxy to use when using uri.
      Returns:
      proxy
    • description

      String description()
      Description of this resource when configured through plain text or binary.
      Returns:
      description