@API(status=EXPERIMENTAL, since="1.11") public interface Resource
Represents a resource on the classpath.
Since:
1.11
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    default InputStream
    Returns an input stream for reading this resource.
    Get the resource name.
    Get URI to a resource.
  • Method Details

    • getName

      String getName()
      Get the resource name.

      The resource name is a /-separated path. The path is relative to the classpath root in which the resource is located.

      Returns:
      the resource name; never null
    • getUri

      URI getUri()
      Get URI to a resource.
      Returns:
      the uri of the resource; never null
    • getInputStream

      default InputStream getInputStream() throws IOException
      Returns an input stream for reading this resource.
      Returns:
      an input stream for this resource; never null
      Throws:
      IOException - if an I/O exception occurs