public class Binary extends NamedResource implements File
Modifier and Type | Field and Description |
---|---|
protected static Logger |
__logger
The binary's logger
|
protected String |
_hash
the binary's hash
|
protected String |
_path
The path of the resource in the repository
|
_filename
_buffer, _encoding, _lastModificationDate, _mimeType, _repositoryData, _tmpFile
Constructor and Description |
---|
Binary()
Default constructor
|
Binary(RepositoryData repositoryData,
String hash)
Constructor to use when reading the binary from the repository
|
Modifier and Type | Method and Description |
---|---|
protected void |
closeOutputStream(ByteArrayOutputStream outputStream)
Closes the given
OutputStream |
String |
getHash()
Retrieves the hash of the resource's data
|
String |
getName()
Retrieves the file's name
|
String |
getPath()
Returns the path of this resource in its hierarchy (which is a subset of the whole repository).
|
getFilename, setFilename
getEncoding, getInputStream, getLastModificationDate, getLength, getMimeType, getOutputStream, setEncoding, setInputStream, setLastModificationDate, setMimeType
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getInputStream, getLastModificationDate, getLength, getMimeType, setLastModificationDate, setMimeType
public Binary()
public Binary(RepositoryData repositoryData, String hash)
repositoryData
- the repository data containing the resource's datahash
- the hash of the resource's dataprotected void closeOutputStream(ByteArrayOutputStream outputStream) throws IOException
Resource
OutputStream
closeOutputStream
in class Resource
outputStream
- the OutputStream
to closeIOException
- if an error occurs while registering the streampublic String getHash()