Interface StaticFileService


public interface StaticFileService
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Deletes a static file.
    Returns the content length of a file stored in the static file service.
    Returns an InputStream to read a file from the static file service by its UUID.
    Returns the original filename of a file stored in the static file service.
    void
    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

      InputStream getFile(String uuid) throws org.opencastproject.util.NotFoundException, IOException
      Returns an InputStream to 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

      String getFileName(String uuid) throws org.opencastproject.util.NotFoundException
      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

      Long getContentLength(String uuid) throws org.opencastproject.util.NotFoundException
      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

      String storeFile(String filename, InputStream inputStream) throws IOException
      Stores a file in the temporary storage section of the static file service. Make sure you call persistFile(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 - The InputStream that represents the file itself.
      Returns:
      A UUID that represents the static file.
      Throws:
      IOException - Thrown if there is a problem storing the file.
    • persistFile

      void persistFile(String uuid) throws org.opencastproject.util.NotFoundException, IOException
      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

      void deleteFile(String uuid) throws org.opencastproject.util.NotFoundException, IOException
      Deletes a static file.
      Parameters:
      uuid - The uuid of the static file.
      Throws:
      org.opencastproject.util.NotFoundException - if the file cannot be found.
      IOException