@ThreadSafe public class FileUrlBinaryValue extends UrlBinaryValue
UrlBinaryValue to lazily compute a contentBased Hash when the key is a URI based HashEMPTY_CONTENT| Constructor and Description |
|---|
FileUrlBinaryValue(String sha1,
String sourceName,
URL content,
long size,
String nameHint,
MimeTypeDetector mimeTypeDetector) |
| 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.
|
getStream, toUrlgetId, getMimeType, getMimeType, getSize, getSourceName, hasMimeType, setMimeType, toStringcompareTo, dispose, equals, getKey, getReadableSize, hashCode, keyFor, readpublic FileUrlBinaryValue(String sha1, String sourceName, URL content, long size, String nameHint, MimeTypeDetector mimeTypeDetector)
public byte[] getHash()
BinaryRepeatedly calling this method should generally be efficient, as it most implementations will compute the hash only once.
getHash in class AbstractBinaryMessageDigest.digest(byte[]),
MessageDigest.getInstance(String),
Binary.getHexHash()public String getHexHash()
BinaryRepeatedly calling this method should generally be efficient, as it most implementations will compute the hash only once.
getHexHash in class AbstractBinaryBinary.getHash(), or a null string if the hash could not be computed or is not knownMessageDigest.digest(byte[]),
MessageDigest.getInstance(String),
Binary.getHash()Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.