Package dev.voidframework.vfs.engine
Class DiskVirtualFileStorage
java.lang.Object
dev.voidframework.vfs.engine.DiskVirtualFileStorage
- All Implemented Interfaces:
VirtualFileStorage
Virtual File Storage: Disk.
- Since:
- 1.3.0
-
Constructor Summary
ConstructorsConstructorDescriptionDiskVirtualFileStorage(com.typesafe.config.Config configuration) Build a new instance. -
Method Summary
Modifier and TypeMethodDescriptionbooleandeleteFile(String fileName) Deletes a specific file.retrieveFile(String fileName) Retrieves a specific file content.booleanstoreFile(String fileName, String contentType, InputStream contentStream) Stores the given file content on the storage.booleanstoreFile(String fileName, String contentType, InputStream contentStream, Properties properties) Stores the given file content on the storage.
-
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
Description copied from interface:VirtualFileStorageRetrieves a specific file content.- Specified by:
retrieveFilein interfaceVirtualFileStorage- Parameters:
fileName- Name of the file to retrieve- Returns:
- A stream containing the file content
-
storeFile
Description copied from interface:VirtualFileStorageStores the given file content on the storage.- Specified by:
storeFilein interfaceVirtualFileStorage- Parameters:
fileName- Name of the file to storecontentType- Content type (ie: image/png)contentStream- Stream containing the file content- Returns:
truein case of success, otherwisefalse
-
storeFile
public boolean storeFile(String fileName, String contentType, InputStream contentStream, Properties properties) Description copied from interface:VirtualFileStorageStores the given file content on the storage.- Specified by:
storeFilein interfaceVirtualFileStorage- Parameters:
fileName- Name of the file to storecontentType- Content type (ie: image/png)contentStream- Stream containing the file contentproperties- Additional properties to use when storing the file (depends on the used backend)- Returns:
truein case of success, otherwisefalse
-
deleteFile
Description copied from interface:VirtualFileStorageDeletes a specific file.- Specified by:
deleteFilein interfaceVirtualFileStorage- Parameters:
fileName- Name of the file to delete- Returns:
truein case of success, otherwisefalse
-