Class FileObjectRepository

  • All Implemented Interfaces:
    Serializable, org.pentaho.reporting.libraries.repository.Repository, org.pentaho.reporting.libraries.repository.UrlRepository

    public class FileObjectRepository
    extends Object
    implements org.pentaho.reporting.libraries.repository.UrlRepository, 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 filesystem.
    Author:
    Thomas Morgner Implementation for VFS. Original implementation(FileRepository) should be removed after reporting will use VFS., Alexander Buloichik
    See Also:
    Serialized Form
    • Constructor Detail

      • FileObjectRepository

        public FileObjectRepository​(org.apache.commons.vfs2.FileObject file)
                             throws org.pentaho.reporting.libraries.repository.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:
        org.pentaho.reporting.libraries.repository.ContentIOException - if an error prevents the repository creation.
      • FileObjectRepository

        public FileObjectRepository​(org.apache.commons.vfs2.FileObject file,
                                    org.pentaho.reporting.libraries.repository.MimeRegistry mimeRegistry)
                             throws org.pentaho.reporting.libraries.repository.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:
        org.pentaho.reporting.libraries.repository.ContentIOException - if an error prevents the repository creation.
    • Method Detail

      • getMimeRegistry

        public org.pentaho.reporting.libraries.repository.MimeRegistry getMimeRegistry()
        Returns the mime-registry for the repository.
        Specified by:
        getMimeRegistry in interface org.pentaho.reporting.libraries.repository.Repository
        Returns:
        the mime-registry.
      • getRoot

        public org.pentaho.reporting.libraries.repository.ContentLocation getRoot()
                                                                           throws org.pentaho.reporting.libraries.repository.ContentIOException
        Returns the repositories root directory entry.
        Specified by:
        getRoot in interface org.pentaho.reporting.libraries.repository.Repository
        Returns:
        the root directory.
        Throws:
        org.pentaho.reporting.libraries.repository.ContentIOException - if an error occurs.
      • getURL

        public URL getURL()
                   throws 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 org.pentaho.reporting.libraries.repository.UrlRepository
        Returns:
        the repository's URL.
        Throws:
        MalformedURLException - if the URL could not be computed.