|
Project Wonder 5.0 | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecter.extensions.foundation.ERXFileRepository
public class ERXFileRepository
Allows you to store a large amount of files and folders without the hassles
of directory size limitations. The files are stored by an abstract
"key" which is by default a ERXRandomGUID
.
It uses a factory to create the folder structure under the root
directory. With the default factory there will be directories for the first
two characters and under these again directories for the next two characters
of the GUID.
Nested Class Summary | |
---|---|
static class |
ERXFileRepository.DefaultFactory
Default implementation of the Factory interface. |
static interface |
ERXFileRepository.Factory
|
Field Summary | |
---|---|
protected ERXFileRepository.Factory |
_factory
|
protected java.io.File |
_root
|
Constructor Summary | |
---|---|
protected |
ERXFileRepository(java.io.File root,
ERXFileRepository.Factory factory)
Private constructor, as we use the factory methods to create instances. |
Method Summary | |
---|---|
static ERXFileRepository |
addRepository(java.lang.String name,
ERXFileRepository repository)
Adds an existing repository under the given name. |
static ERXFileRepository |
addRepository(java.lang.String name,
java.io.File root)
Adds a repository under the given name and the given root directory that uses the default factory. |
static ERXFileRepository |
addRepository(java.lang.String name,
java.io.File root,
ERXFileRepository.Factory factory)
Adds a repository under the given name and the given root directory that uses the given factory. |
java.io.File |
createFile()
Returns a new file in the repository. |
java.io.File |
getFile(java.lang.String id)
Returns a file for a given id |
java.io.File |
getRoot()
Returns the root directory for the repository. |
boolean |
hasFile(java.lang.String id)
Returns true if the file is present in the repository and also exists. |
static ERXFileRepository |
respository(java.lang.String name)
Returns the repository that is registered under the given name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.io.File _root
protected final ERXFileRepository.Factory _factory
Constructor Detail |
---|
protected ERXFileRepository(java.io.File root, ERXFileRepository.Factory factory)
root
- factory
- Method Detail |
---|
public java.io.File createFile()
public java.io.File getFile(java.lang.String id)
id
- the id of the file
public boolean hasFile(java.lang.String id)
id
- the id of the file
public java.io.File getRoot()
public static ERXFileRepository respository(java.lang.String name)
name
- the name under which the respository is registered
public static ERXFileRepository addRepository(java.lang.String name, java.io.File root)
name
- the name under which the repository should be addedroot
- the root directory of the repository
public static ERXFileRepository addRepository(java.lang.String name, java.io.File root, ERXFileRepository.Factory factory)
name
- the name under which the repository should be addedroot
- the root directory of the repositoryfactory
- the factory to determine the directory from the id for this repository
public static ERXFileRepository addRepository(java.lang.String name, ERXFileRepository repository)
name
- the name under which the repository should be addedrepository
- the repository to register
|
Last updated: Tue, Feb 21, 2017 05:45 PM CET | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |