Package org.salespointframework.files
Interface NamedBinary
- All Superinterfaces:
org.jmolecules.ddd.types.ValueObject
public interface NamedBinary
extends org.jmolecules.ddd.types.ValueObject
An abstraction for files originating from different sources.
- Since:
- 7.5
- Author:
- Oliver Drotbohm
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionThe actual file content.getName()
The name of the file to be stored.static NamedBinary
Creates a newNamedBinary
for the givenPath
.static NamedBinary
Creates a newNamedBinary
for the givenResource
.static NamedBinary
of
(MultipartFile file) Creates a newNamedBinary
for the givenMultipartFile
.default NamedBinary
Creates a newNamedBinary
instance with the given name.
-
Method Details
-
getName
String getName()The name of the file to be stored.- Returns:
- will never be null or empty.
-
getInputStream
The actual file content.- Returns:
- will never be null.
- Throws:
IOException
-
of
Creates a newNamedBinary
for the givenPath
.- Parameters:
path
- must not be null.- Returns:
- will never be null.
-
of
Creates a newNamedBinary
for the givenResource
.- Parameters:
resource
- must not be null.- Returns:
- will never be null.
-
of
Creates a newNamedBinary
for the givenMultipartFile
.- Parameters:
file
- must not be null.- Returns:
- will never be null.
-
withName
Creates a newNamedBinary
instance with the given name. The underlying binary data does not change.- Parameters:
name
- must not be null or empty.- Returns:
- will never be null.
- Since:
- 9.0
-