Package org.pentaho.reporting.libraries.repository.file

# Class FileRepository

java.lang.Object
org.pentaho.reporting.libraries.repository.file.FileRepository

All Implemented Interfaces:
  `Serializable`, `Repository`, `UrlRepository`

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
See Also:
  - Serialized Form

## Constructor Summary

Constructors
Constructor
Description
`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

Modifier and Type
Method
Description
`MimeRegistry`
`getMimeRegistry()`
Returns the mime-registry for the repository.
`ContentLocation`
`getRoot()`
Returns the repositories root directory entry.
`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 Details

### FileRepository

public FileRepository(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(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 Details

### getMimeRegistry

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

Specified by:
  `getMimeRegistry` in interface `Repository`
Returns:
  the mime-registry.
See Also:
  - `MimeRegistry`

### getRoot

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

Specified by:
  `getRoot` in interface `Repository`
Returns:
  the root directory.
Throws:
  `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 `UrlRepository`
Returns:
  the repository's URL.
Throws:
  `MalformedURLException` - if the URL could not be computed.