Interface SetupResource

All Known Implementing Classes:
BaseStaticSetupResource, ClasspathSetupResource, ResourceSetupResource

public interface SetupResource
API for a setting resource.
Version:
1.1
Author:
matt
  • Field Details

  • Method Details

    • getResourceUID

      String getResourceUID()
      Get a globally unique identifier for this resource.
      Returns:
      The identifier.
    • getContentType

      String getContentType()
      Get the content type of this resource.
      Returns:
      The content type.
    • getRequiredRoles

      Set<String> getRequiredRoles()
      Get a set of required security roles, or null if none required. The set is treated such that any matching role is allowed access, that is the roles are logically OR'ed together.
      Returns:
      A set of required roles, or null if no role required.
    • getSupportedConsumerTypes

      Set<String> getSupportedConsumerTypes()
      Get a set of supported consumer types, or null if all types are supported.
      Returns:
      A set of supported consumer types, or null if all types are supported.
    • getLocale

      Locale getLocale()
      The locale of the resource, or null for non-localizable content.
      Returns:
      The locale, or null.
    • getCacheMaximumSeconds

      int getCacheMaximumSeconds()
      Get a maximum number of seconds this resource may be cached for, or -1 if no caching should be allowed.
      Returns:
      The maximum number of seconds the resource may be cached for.
    • contentLength

      long contentLength() throws IOException
      Determine the content length for this resource.
      Returns:
      the content length, or -1 if not known
      Throws:
      IOException - if the resource cannot be resolved (in the file system or as some other known physical resource type)
    • lastModified

      long lastModified() throws IOException
      Determine the last-modified timestamp for this resource.
      Returns:
      the last modified timestamp, or -1 if not known
      Throws:
      IOException - if the resource cannot be resolved (in the file system or as some other known physical resource type)
    • getInputStream

      InputStream getInputStream() throws IOException
      Return a new InputStream. This method should return a new stream each time it is called.
      Returns:
      the input stream for the underlying resource (must not be null)
      Throws:
      IOException - if the stream could not be opened
    • getScope

      SetupResourceScope getScope()
      Get the scope of the resource, or null if undefined.
      Returns:
      the resource scope
      Since:
      1.1