Package dev.voidframework.vfs.engine
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 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.
-
Method Details
-
retrieveFile
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
Stores the given file content on the storage.- 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- 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 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- Since:
- 1.3.0
-
deleteFile
Deletes a specific file.- Parameters:
fileName- Name of the file to delete- Returns:
truein case of success, otherwisefalse- Since:
- 1.3.0
-