Class FileResource

java.lang.Object
helma.framework.repository.AbstractResource
helma.framework.repository.FileResource
All Implemented Interfaces:
Resource

public class FileResource extends AbstractResource
  • Constructor Details

    • FileResource

      public FileResource(File file)
    • FileResource

      protected FileResource(File file, Repository repository)
  • Method Details

    • getName

      public String getName()
      Description copied from interface: Resource
      Returns the name of the resource; does not include the name of the repository the resource was fetched from
      Returns:
      name of the resource
    • getShortName

      public String getShortName()
      Description copied from interface: Resource
      Returns the short name of the resource which is its name exclusive file ending if it exists
      Returns:
      short name of the resource
    • getBaseName

      public String getBaseName()
      Description copied from interface: Resource
      Returns the short name of the resource with the file extension (everything following the last dot character) cut off.
      Returns:
      the file name without the file extension
    • getInputStream

      public InputStream getInputStream() throws IOException
      Description copied from interface: Resource
      Returns an input stream to the content of the resource
      Returns:
      content input stream
      Throws:
      IOException - I/O related problem
    • getUrl

      public URL getUrl()
      Description copied from interface: Resource
      Returns an url to the resource if the repository of this resource is able to provide urls
      Returns:
      url to the resource
    • lastModified

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

      public String getContent(String encoding) throws IOException
      Description copied from interface: Resource
      Returns the content of the resource in a given encoding
      Parameters:
      encoding - the character encoding
      Returns:
      content
      Throws:
      IOException - I/O related problem
    • getContent

      public String getContent() throws IOException
      Description copied from interface: Resource
      Returns the content of the resource
      Returns:
      content
      Throws:
      IOException - I/O related problem
    • getLength

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

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

      public Repository getRepository()
      Description copied from interface: Resource
      Returns the repository the resource does belong to
      Returns:
      upper repository
    • hashCode

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

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object