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