Package org.salespointframework.files
Interface FileStorage
An application service to store
NamedBinary
instances and obtain them as Resource
s.- Since:
- 7.5
- Author:
- Oliver Drotbohm
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Deletes all files currently contained in theFileStorage
.void
deleteByName
(String filename) Deletes the file with the given name.forUser
(UserAccount.UserAccountIdentifier userAccountIdentifier) Returns theFileStorage
for theUserAccount
identified by the givenUserAccount.UserAccountIdentifier
.Returns all storedResource
s.getResource
(String filename) Returns theResource
for the given file name.store
(NamedBinary binary) Stores the givenNamedBinary
.
-
Method Details
-
store
Stores the givenNamedBinary
. Publishes aFileStored
event for other interested parties to react to just stored files.- Parameters:
binary
- must not be null.- Returns:
- will never be null.
-
getAllResources
Streamable<Resource> getAllResources()Returns all storedResource
s.- Returns:
- will never be null.
-
getResource
Returns theResource
for the given file name.- Parameters:
filename
- must not be null or empty.- Returns:
- will never be null.
-
deleteAll
void deleteAll()Deletes all files currently contained in theFileStorage
. -
deleteByName
Deletes the file with the given name.- Parameters:
filename
- must not be null or empty.- Since:
- 9.0
-
forUser
Returns theFileStorage
for theUserAccount
identified by the givenUserAccount.UserAccountIdentifier
.- Parameters:
userAccountIdentifier
- must not be null.- Returns:
- will never be null.
-