public interface Binary extends Binary
Binary interface, with methods to obtain the SHA-1 hash of the binary value.| Modifier and Type | Method and Description |
|---|---|
byte[] |
getHash()
Get the SHA-1 hash of the contents.
|
String |
getHexHash()
Get the hexadecimal form of the SHA-1 hash of the contents.
|
String |
getMimeType()
Get the MIME type for this binary value.
|
String |
getMimeType(String name)
Get the MIME type for this binary value.
|
byte[] getHash()
Repeatedly calling this method should generally be efficient, as it most implementations will compute the hash only once.
MessageDigest.digest(byte[]),
MessageDigest.getInstance(String),
getHexHash()String getHexHash()
Repeatedly calling this method should generally be efficient, as it most implementations will compute the hash only once.
getHash(), or a null string if the hash could not be computed or is not knownMessageDigest.digest(byte[]),
MessageDigest.getInstance(String),
getHash()String getMimeType() throws IOException, RepositoryException
IOException - if there is a problem reading the binary contentRepositoryException - if an error occurs.String getMimeType(String name) throws IOException, RepositoryException
name - the name of the binary value, useful in helping to determine the MIME typeIOException - if there is a problem reading the binary contentRepositoryException - if an error occurs.Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.