Interface StaticFileService
public interface StaticFileService
-
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteFile(String uuid) Deletes a static file.getContentLength(String uuid) Returns the content length of a file stored in the static file service.Returns anInputStreamto read a file from the static file service by its UUID.getFileName(String uuid) Returns the original filename of a file stored in the static file service.voidpersistFile(String uuid) Persists a file that was previously uploaded to the temporary storage section with#storeFile(String, InputStream)for long-term usage.storeFile(String filename, InputStream inputStream) Stores a file in the temporary storage section of the static file service.
-
Method Details
-
getFile
Returns anInputStreamto read a file from the static file service by its UUID.- Parameters:
uuid- The UUID of the file.- Returns:
- The input stream to read the file
- Throws:
org.opencastproject.util.NotFoundException- Thrown if the file cannot be found.IOException- If the file could not be read.
-
getFileName
Returns the original filename of a file stored in the static file service.- Parameters:
uuid- The UUID of the file.- Returns:
- The filename.
- Throws:
org.opencastproject.util.NotFoundException- If the file with the given UUID was not found.
-
getContentLength
Returns the content length of a file stored in the static file service.- Parameters:
uuid- The UUID of the file.- Returns:
- The content length.
- Throws:
org.opencastproject.util.NotFoundException- If the file with the given UUID was not found.
-
storeFile
Stores a file in the temporary storage section of the static file service. Make sure you callpersistFile(String)if you want to persist a file durable. A file that is stored in the temporary storage section may be removed at any time without notice!- Parameters:
filename- The filename and extension for the file.inputStream- TheInputStreamthat represents the file itself.- Returns:
- A UUID that represents the static file.
- Throws:
IOException- Thrown if there is a problem storing the file.
-
persistFile
Persists a file that was previously uploaded to the temporary storage section with#storeFile(String, InputStream)for long-term usage.- Parameters:
uuid- The UUID of the file to persist.- Throws:
org.opencastproject.util.NotFoundException- If the file could not be found.IOException
-
deleteFile
Deletes a static file.- Parameters:
uuid- The uuid of the static file.- Throws:
org.opencastproject.util.NotFoundException- if the file cannot be found.IOException
-