Interface Resource

    • Method Detail

      • getFileName

        Optional<String> getFileName()
        Gets the file name of this resource.
        Returns:
        the name of this Resource.
      • exists

        boolean exists()
        Tests whether a resource exists.
        Returns:
        true if the resource exists
      • isWritable

        boolean isWritable()
        Tests whether a resource is writable.
        Returns:
        true if the resource exists and is writable
      • isReadable

        boolean isReadable()
        Tests whether a resource is readable.
        Returns:
        true if the resource exists and is readable
      • getInputStream

        InputStream getInputStream()
                            throws IOException
        Open an InputStream for the underlying resource.
        Returns:
        the input stream for the resource
        Throws:
        IOException - if resource does not exist or an I/O error occurs
      • getOutputStream

        OutputStream getOutputStream()
                              throws IOException
        Open an OutputStream for the underlying resource.
        Returns:
        the output stream for the resource
        Throws:
        IOException - if resource does not exist or an I/O error occurs
      • toURL

        URL toURL()
           throws IOException
        Gets a URL to the underlying resource.
        Returns:
        the URL to the resource
        Throws:
        IOException - if resource does not exist, or URL cannot be built
      • toURI

        default URI toURI()
                   throws IOException
        Gets a URI to the underlying resource.
        Returns:
        the URI to the resource
        Throws:
        IOException - if resource does not exist, or URI cannot be built