Class FileResource

    • Constructor Detail

      • FileResource

        public FileResource​(java.lang.String path)
                     throws java.io.IOException
        Throws:
        java.io.IOException
      • FileResource

        public FileResource​(java.io.File file)
                     throws java.io.IOException
        Throws:
        java.io.IOException
      • FileResource

        protected FileResource​(java.io.File file,
                               FileRepository repository)
                        throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • getInputStream

        public java.io.InputStream getInputStream()
                                           throws java.io.IOException
        Description copied from interface: Resource
        Returns an input stream to the content of the resource
        Returns:
        content input stream
        Throws:
        java.io.IOException - if a I/O related error occurs
      • getUrl

        public java.net.URL getUrl()
                            throws java.net.MalformedURLException
        Description copied from interface: Trackable
        Returns an url to the resource if the repository of this resource is able to provide urls.
        Returns:
        url to the resource
        Throws:
        java.net.MalformedURLException
      • lastModified

        public long lastModified()
        Description copied from interface: Trackable
        Returns the date the resource was last modified
        Returns:
        last modified date
      • getLength

        public long getLength()
        Description copied from interface: Resource
        Returns the length of the resource's content
        Returns:
        content length
      • exists

        public boolean exists()
        Description copied from interface: Trackable
        Checks wether this resource actually (still) exists
        Returns:
        true if the resource exists
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object