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, wait
forEach, spliterator
public File getTemporaryFolder()
FoldersManager
getTemporaryFolder
in interface FoldersManager
public void setTemporaryFolder(File folder)
FoldersManager
setTemporaryFolder
in interface FoldersManager
public void cleanTemporaryFiles()
FoldersManager
cleanTemporaryFiles
in interface FoldersManager
public File createTemporaryFolder()
FoldersManager
createTemporaryFolder
in interface FoldersManager
public File getTemporaryFile(String... pathComponents)
FoldersManager
getTemporaryFile
in interface FoldersManager
public File getUniqueTemporaryFile(String... pathComponents)
FoldersManager
getUniqueTemporaryFile
in interface FoldersManager
public File createTemporaryFile(String basename, byte[] data)
FoldersManager
createTemporaryFile
in interface FoldersManager
basename
- of the temporary file to createdata
- The data to store in the filepublic File createTemporaryFile(String basename, String data) throws IOException
createTemporaryFile
in interface FoldersManager
IOException
public void set(String id, File file)
FoldersManager
set
in interface FoldersManager
public File get(String id)
FoldersManager
get
in interface FoldersManager
public File get(String id, File defaultValue)
FoldersManager
get
in interface FoldersManager
public Iterator<String> iterator()
FoldersManager
iterator
in interface Iterable<String>
iterator
in interface FoldersManager
public boolean isEmpty()
FoldersManager
isEmpty
in interface FoldersManager