Class DiskVirtualFileStorage

java.lang.Object
dev.voidframework.vfs.engine.DiskVirtualFileStorage
All Implemented Interfaces:
VirtualFileStorage

public class DiskVirtualFileStorage extends Object implements VirtualFileStorage
Virtual File Storage: Disk.
Since:
1.3.0
  • Constructor Details

    • DiskVirtualFileStorage

      @Inject public DiskVirtualFileStorage(com.typesafe.config.Config configuration)
      Build a new instance.
      Parameters:
      configuration - The application configuration
      Since:
      1.3.0
  • Method Details

    • retrieveFile

      public InputStream retrieveFile(String fileName)
      Description copied from interface: VirtualFileStorage
      Retrieves a specific file content.
      Specified by:
      retrieveFile in interface VirtualFileStorage
      Parameters:
      fileName - Name of the file to retrieve
      Returns:
      A stream containing the file content
    • storeFile

      public boolean storeFile(String fileName, String contentType, InputStream contentStream)
      Description copied from interface: VirtualFileStorage
      Stores the given file content on the storage.
      Specified by:
      storeFile in interface VirtualFileStorage
      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
    • storeFile

      public boolean storeFile(String fileName, String contentType, InputStream contentStream, Properties properties)
      Description copied from interface: VirtualFileStorage
      Stores the given file content on the storage.
      Specified by:
      storeFile in interface VirtualFileStorage
      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
    • deleteFile

      public boolean deleteFile(String fileName)
      Description copied from interface: VirtualFileStorage
      Deletes a specific file.
      Specified by:
      deleteFile in interface VirtualFileStorage
      Parameters:
      fileName - Name of the file to delete
      Returns:
      true in case of success, otherwise false