@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.
|
internalStream, toUrl
getId, getMimeType, getMimeType, getSize, getSourceName, hasMimeType, setMimeType, toString
compareTo, dispose, equals, getKey, getReadableSize, getStream, hashCode, keyFor, read
public FileUrlBinaryValue(String sha1, String sourceName, URL content, long size, String nameHint, MimeTypeDetector mimeTypeDetector)
public byte[] getHash()
Binary
Repeatedly calling this method should generally be efficient, as it most implementations will compute the hash only once.
getHash
in class AbstractBinary
MessageDigest.digest(byte[])
,
MessageDigest.getInstance(String)
,
Binary.getHexHash()
public String getHexHash()
Binary
Repeatedly calling this method should generally be efficient, as it most implementations will compute the hash only once.
getHexHash
in class AbstractBinary
Binary.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–2016 JBoss, a division of Red Hat. All rights reserved.