Interface VirtualFileStorage

All Known Implementing Classes:
DiskVirtualFileStorage, MemoryVirtualFileStorage

public interface VirtualFileStorage
Allows manipulation of files without worrying about the type of storage.
Since:
1.3.0
  • Method Details

    • retrieveFile

      InputStream retrieveFile(String fileName)
      Retrieves a specific file content.
      Parameters:
      fileName - Name of the file to retrieve
      Returns:
      A stream containing the file content
      Since:
      1.3.0
    • storeFile

      boolean storeFile(String fileName, String contentType, InputStream contentStream)
      Stores the given file content on the storage.
      Parameters:
      fileName - Name of the file to store
      contentType - Content type (ie: image/png)
      contentStream - Stream containing the file content
      Returns:
      true in case of success, otherwise false
      Since:
      1.3.0
    • storeFile

      boolean storeFile(String fileName, String contentType, InputStream contentStream, Properties properties)
      Stores the given file content on the storage.
      Parameters:
      fileName - Name of the file to store
      contentType - Content type (ie: image/png)
      contentStream - Stream containing the file content
      properties - Additional properties to use when storing the file (depends on the used backend)
      Returns:
      true in case of success, otherwise false
      Since:
      1.3.0
    • deleteFile

      boolean deleteFile(String fileName)
      Deletes a specific file.
      Parameters:
      fileName - Name of the file to delete
      Returns:
      true in case of success, otherwise false
      Since:
      1.3.0