org.pentaho.reporting.libraries.repository.file

Class FileRepository

public class FileRepository extends Object implements 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 filsystem.

Author: Thomas Morgner

Constructor Summary
FileRepository(File file)
Creates a new repository for the given file.
FileRepository(File file, MimeRegistry mimeRegistry)
Creates a new repository for the given file.
Method Summary
MimeRegistrygetMimeRegistry()
Returns the mime-registry for the repository.
ContentLocationgetRoot()
Returns the repositories root directory entry.
URLgetURL()
Returns the URL that represents this repository.

Constructor Detail

FileRepository

public FileRepository(File file)
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(File file, MimeRegistry mimeRegistry)
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

getMimeRegistry

public MimeRegistry getMimeRegistry()
Returns the mime-registry for the repository.

Returns: the mime-registry.

getRoot

public ContentLocation getRoot()
Returns the repositories root directory entry.

Returns: the root directory.

Throws: ContentIOException if an error occurs.

getURL

public URL getURL()
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.

Returns: the repository's URL.

Throws: MalformedURLException if the URL could not be computed.