Package de.xima.fc.common.file
Class ByteArrayFile
- java.lang.Object
 - 
- de.xima.fc.common.file.ByteArrayFile
 
 
- 
- All Implemented Interfaces:
 Serializable
public final class ByteArrayFile extends Object implements Serializable
The binary data of a file, along with some metadata such as the file name.- Since:
 - 8.3.0
 - Author:
 - XIMA MEDIA GmbH
 - See Also:
 - Serialized Form
 
 
- 
- 
Constructor Summary
Constructors Constructor Description ByteArrayFile(String fileName, String contentType, byte[] data)Creates a new instance with the given file name and binary data. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringcontentType()Gets the content type of the file, if known.byte[]data()Gets the binary data of the file.StringfileName()Gets the file name or path. 
 - 
 
- 
- 
Constructor Detail
- 
ByteArrayFile
public ByteArrayFile(String fileName, String contentType, byte[] data)
Creates a new instance with the given file name and binary data.- Parameters:
 fileName- The file name or path. Should not be null.contentType- The content type, if known, empty otherwise.data- The binary data of the file. Should not be null, but can be empty.
 
 - 
 
- 
Method Detail
- 
contentType
public String contentType()
Gets the content type of the file, if known. Returns empty string if not known.- Returns:
 - The content type of the file.
 
 
- 
data
public byte[] data()
Gets the binary data of the file.- Returns:
 - The binary data of the file.
 
 
- 
fileName
public String fileName()
Gets the file name or path.- Returns:
 - The file name or path.
 
 
 - 
 
 -