public class DefaultFoldersManager extends java.lang.Object implements FoldersManager
Constructor and Description |
---|
DefaultFoldersManager() |
Modifier and Type | Method and Description |
---|---|
void |
cleanTemporaryFiles()
Remove al files in the temporary folder.
|
java.io.File |
createTemporaryFile(java.lang.String basename,
byte[] data)
Creates a temporary file with a the provided name and data.
|
java.io.File |
createTemporaryFile(java.lang.String basename,
java.lang.String data) |
java.io.File |
createTemporaryFolder()
Force the creation of the temporary folder.
|
java.io.File |
get(java.lang.String id)
Retrieves the file associated with the indicated identifier.
|
java.io.File |
get(java.lang.String id,
java.io.File defaultValue)
Retrieves the file associated with the indicated identifier.
|
java.io.File |
getHome() |
java.io.File |
getLastPath(java.lang.String pathId) |
java.io.File |
getLastPath(java.lang.String pathId,
java.io.File defaultValue) |
java.io.File |
getTemporaryFile(java.lang.String... pathComponents)
Return a file with the specified relative path to the
temporary folder.
|
java.io.File |
getTemporaryFolder()
Return the file associated to the temporary folder.
|
java.io.File |
getUniqueFile(java.lang.String... pathComponents)
Return a unique file with the specified path.
|
java.io.File |
getUniqueTemporaryFile(java.lang.String... pathComponents)
Return a unique file with the specified relative path to the
temporary folder.
|
boolean |
isEmpty()
Returns true if there is no stored file.
|
java.util.Iterator<java.lang.String> |
iterator()
Returns an iterator over the identifiers of the stored files.
|
java.util.Iterator<java.util.Map.Entry<java.lang.String,java.io.File>> |
lastPathsIterator() |
void |
set(java.lang.String id,
java.io.File file)
Stores the file with the indicated identifier.
|
void |
setLastPath(java.lang.String pathId,
java.io.File path) |
void |
setTemporaryFolder(java.io.File folder)
Set the file associated to the temporary folder.
|
public boolean isEmpty()
FoldersManager
isEmpty
in interface FoldersManager
public void setLastPath(java.lang.String pathId, java.io.File path)
setLastPath
in interface FoldersManager
public java.io.File getLastPath(java.lang.String pathId)
getLastPath
in interface FoldersManager
public java.io.File getLastPath(java.lang.String pathId, java.io.File defaultValue)
getLastPath
in interface FoldersManager
public java.util.Iterator<java.util.Map.Entry<java.lang.String,java.io.File>> lastPathsIterator()
lastPathsIterator
in interface FoldersManager
public java.io.File getTemporaryFolder()
FoldersManager
getTemporaryFolder
in interface FoldersManager
public final void setTemporaryFolder(java.io.File folder)
FoldersManager
setTemporaryFolder
in interface FoldersManager
public void cleanTemporaryFiles()
FoldersManager
cleanTemporaryFiles
in interface FoldersManager
public java.io.File createTemporaryFolder()
FoldersManager
createTemporaryFolder
in interface FoldersManager
public java.io.File getTemporaryFile(java.lang.String... pathComponents)
FoldersManager
getTemporaryFile
in interface FoldersManager
public java.io.File getUniqueTemporaryFile(java.lang.String... pathComponents)
FoldersManager
getUniqueTemporaryFile
in interface FoldersManager
public java.io.File getUniqueFile(java.lang.String... pathComponents)
FoldersManager
getUniqueFile
in interface FoldersManager
public java.io.File createTemporaryFile(java.lang.String basename, byte[] data)
FoldersManager
createTemporaryFile
in interface FoldersManager
basename
- of the temporary file to createdata
- The data to store in the filepublic java.io.File createTemporaryFile(java.lang.String basename, java.lang.String data) throws java.io.IOException
createTemporaryFile
in interface FoldersManager
java.io.IOException
public void set(java.lang.String id, java.io.File file)
FoldersManager
set
in interface FoldersManager
public java.io.File get(java.lang.String id)
FoldersManager
get
in interface FoldersManager
public java.io.File get(java.lang.String id, java.io.File defaultValue)
FoldersManager
get
in interface FoldersManager
public java.io.File getHome()
getHome
in interface FoldersManager
public java.util.Iterator<java.lang.String> iterator()
FoldersManager
iterator
in interface java.lang.Iterable<java.lang.String>
iterator
in interface FoldersManager