Class MemoryVirtualFileStorage

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

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

    • MemoryVirtualFileStorage

      public MemoryVirtualFileStorage()
  • 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