Interface Resource

All Known Implementing Classes:
Page

public interface Resource
Represents a web resource used in ui-extensions (such as node view, port view and node dialog).
Since:
4.5
Author:
Martin Horn, KNIME GmbH, Konstanz, Germany
  • Method Details

    • getRelativePath

      String getRelativePath()
      Returns:
      the resource's relative path (including the resource name itself, too)
    • getInputStream

      InputStream getInputStream() throws IOException
      Returns:
      the actual resource content as InputStream
      Throws:
      IOException
    • isStatic

      boolean isStatic()
      A static resource will never change at runtime and thus potentially be 're-used' between, e.g., multiple node instances. I.e. multiple node instances access a static resource at the very same URL which is independent from a specific node instance.
      Returns:
      true if the resource is static and won't ever change at runtime, otherwise false
    • getContentType

      Resource.ContentType getContentType()
      Returns:
      the content type of the resource
    • getCharset

      default Optional<Charset> getCharset()
      Returns:
      the charset the resource uses; an empty optional if it's not a text-based resource or if it's using the default charset (i.e. Charset.defaultCharset()).