public class DefaultFoldersManager extends Object implements FoldersManager
| Constructor and Description |
|---|
DefaultFoldersManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
cleanTemporaryFiles()
Remove al files in the temporary folder.
|
File |
createTemporaryFile(String basename,
byte[] data)
Creates a temporary file with a the provided name and data.
|
File |
createTemporaryFile(String basename,
String data) |
File |
createTemporaryFolder()
Force the creation of the temporary folder.
|
File |
get(String id)
Retrieves the file associated with the indicated identifier.
|
File |
get(String id,
File defaultValue)
Retrieves the file associated with the indicated identifier.
|
File |
getTemporaryFile(String... pathComponents)
Return a file with the specified relative path to the
temporary folder.
|
File |
getTemporaryFolder()
Return the file associated to the temporary folder.
|
File |
getUniqueTemporaryFile(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.
|
Iterator<String> |
iterator()
Returns an iterator over the identifiers of the stored files.
|
void |
set(String id,
File file)
Stores the file with the indicated identifier.
|
void |
setTemporaryFolder(File folder)
Set the file associated to the temporary folder.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic File getTemporaryFolder()
FoldersManagergetTemporaryFolder in interface FoldersManagerpublic void setTemporaryFolder(File folder)
FoldersManagersetTemporaryFolder in interface FoldersManagerpublic void cleanTemporaryFiles()
FoldersManagercleanTemporaryFiles in interface FoldersManagerpublic File createTemporaryFolder()
FoldersManagercreateTemporaryFolder in interface FoldersManagerpublic File getTemporaryFile(String... pathComponents)
FoldersManagergetTemporaryFile in interface FoldersManagerpublic File getUniqueTemporaryFile(String... pathComponents)
FoldersManagergetUniqueTemporaryFile in interface FoldersManagerpublic File createTemporaryFile(String basename, byte[] data)
FoldersManagercreateTemporaryFile in interface FoldersManagerbasename - of the temporary file to createdata - The data to store in the filepublic File createTemporaryFile(String basename, String data) throws IOException
createTemporaryFile in interface FoldersManagerIOExceptionpublic void set(String id, File file)
FoldersManagerset in interface FoldersManagerpublic File get(String id)
FoldersManagerget in interface FoldersManagerpublic File get(String id, File defaultValue)
FoldersManagerget in interface FoldersManagerpublic Iterator<String> iterator()
FoldersManageriterator in interface Iterable<String>iterator in interface FoldersManagerpublic boolean isEmpty()
FoldersManagerisEmpty in interface FoldersManager