Class FileRepository

  • All Implemented Interfaces:
    java.io.Serializable, Repository, UrlRepository

    public class FileRepository
    extends java.lang.Object
    implements UrlRepository, java.io.Serializable
    A file-repository uses a subset of the local filesystem to provide a repository view on top of it. This repository type is the most commonly used repository, as most applications are allowed to access the local filsystem.
    Author:
    Thomas Morgner
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      FileRepository​(java.io.File file)
      Creates a new repository for the given file.
      FileRepository​(java.io.File file, MimeRegistry mimeRegistry)
      Creates a new repository for the given file.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      MimeRegistry getMimeRegistry()
      Returns the mime-registry for the repository.
      ContentLocation getRoot()
      Returns the repositories root directory entry.
      java.net.URL getURL()
      Returns the URL that represents this repository.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FileRepository

        public FileRepository​(java.io.File file)
                       throws ContentIOException
        Creates a new repository for the given file. The file must point to a directory. This constructor uses the default mime-registry.
        Parameters:
        file - the directory, which should form the root of the repository.
        Throws:
        ContentIOException - if an error prevents the repository creation.
      • FileRepository

        public FileRepository​(java.io.File file,
                              MimeRegistry mimeRegistry)
                       throws ContentIOException
        Creates a new repository for the given file. The file must point to a directory.
        Parameters:
        file - the directory, which should form the root of the repository.
        mimeRegistry - the mime registry to be used.
        Throws:
        ContentIOException - if an error prevents the repository creation.
    • Method Detail

      • getURL

        public java.net.URL getURL()
                            throws java.net.MalformedURLException
        Returns the URL that represents this repository. The meaning of the URL returned here is implementation specific and is probably not suitable to resolve names to global objects.
        Specified by:
        getURL in interface UrlRepository
        Returns:
        the repository's URL.
        Throws:
        java.net.MalformedURLException - if the URL could not be computed.