public interface TempFileService
| Modifier and Type | Method and Description |
|---|---|
java.nio.file.Path |
createTempFile()
Creates a temporary file in the temp directory configured.
|
TempFile |
createWebAccessibleTempFile(java.lang.String id,
User... permittedUsers)
Creates a web-accessible temporary file which can be retrieved by the given
id.
|
TempFile |
createWebAccessibleTempFile(User... permittedUsers)
Creates a temporary file which can be retrieved by the returned identifier
(
TempFile.getWebId()) using the TempFileServlet. |
TempFile |
getTempFileById(java.lang.String id)
Given an identifier (web-id), retrieves the corresponding temporary file.
|
boolean |
isTmpFile(java.nio.file.Path path)
Checks if the given file is a temporary file, that is, if is located in a
temporary file location.
|
byte[] |
readTmpFileIntoByteArray(java.nio.file.Path path)
Reads all bytes of a given temporary file into a byte array.
|
byte[] |
readTmpFileIntoByteArray(java.nio.file.Path path,
boolean removeFile)
Reads all bytes of a given temporary file into a byte array.
|
java.nio.file.Path createTempFile()
throws java.io.IOException
java.io.IOException - if an I/O error occursTempFile createWebAccessibleTempFile(java.lang.String id, User... permittedUsers) throws java.io.IOException
id - the web-id of the temporary file.permittedUsers - users allowed to access the temporary filejava.io.IOException - if an I/O error occursTempFile createWebAccessibleTempFile(User... permittedUsers) throws java.io.IOException
TempFile.getWebId()) using the TempFileServlet.permittedUsers - users allowed to access the temporary filejava.io.IOException - if an I/O error occursTempFile getTempFileById(java.lang.String id)
id - the web-idbyte[] readTmpFileIntoByteArray(java.nio.file.Path path)
throws java.io.IOException
path - the temporary file to readjava.io.IOException - if an I/O error occursbyte[] readTmpFileIntoByteArray(java.nio.file.Path path,
boolean removeFile)
throws java.io.IOException
path - the temporary file to readremoveFile - true if the temporary file should be deleted after reading
into a byte arrayjava.io.IOException - if an I/O error occursboolean isTmpFile(java.nio.file.Path path)
path - the file to check