public class ContentStreamHashImpl extends Object implements ContentStreamHash
| Modifier and Type | Field and Description |
|---|---|
static String |
ALGORITHM_MD5 |
static String |
ALGORITHM_SHA1 |
static String |
ALGORITHM_SHA224 |
static String |
ALGORITHM_SHA256 |
static String |
ALGORITHM_SHA3 |
static String |
ALGORITHM_SHA384 |
static String |
ALGORITHM_SHA512 |
| Constructor and Description |
|---|
ContentStreamHashImpl(String propertyValue)
Constructs an object from the
cmis:contentStreamHash property
value. |
ContentStreamHashImpl(String algorithm,
byte[] hashBytes)
Constructs an object from the algorithm and hash.
|
ContentStreamHashImpl(String algorithm,
String hashStr)
Constructs an object from the algorithm and hash.
|
| Modifier and Type | Method and Description |
|---|---|
protected static String |
byteArrayToHexString(byte[] bytes) |
static List<ContentStreamHash> |
createContentStreamHashes(InputStream stream,
String... algorithm)
Creates a list of content hashes from a stream
|
boolean |
equals(Object obj) |
String |
getAlgorithm()
Returns the hash algorithm.
|
String |
getHash()
Returns the hash value.
|
String |
getPropertyValue()
Returns the content hash property value (
cmis:contentStreamHash). |
int |
hashCode() |
String |
toString() |
public static final String ALGORITHM_MD5
public static final String ALGORITHM_SHA1
public static final String ALGORITHM_SHA224
public static final String ALGORITHM_SHA256
public static final String ALGORITHM_SHA384
public static final String ALGORITHM_SHA512
public static final String ALGORITHM_SHA3
public ContentStreamHashImpl(String propertyValue)
cmis:contentStreamHash property
value.propertyValue - the property valuepublic ContentStreamHashImpl(String algorithm, String hashStr)
algorithm - the algorithmhash - the hash valuepublic ContentStreamHashImpl(String algorithm, byte[] hashBytes)
algorithm - the algorithmhashBytes - the hash value as byte arraypublic String getPropertyValue()
ContentStreamHashcmis:contentStreamHash).getPropertyValue in interface ContentStreamHashpublic String getAlgorithm()
ContentStreamHashgetAlgorithm in interface ContentStreamHashnull if the property value is
invalidpublic String getHash()
ContentStreamHashgetHash in interface ContentStreamHashnull if the property value is invalidpublic static List<ContentStreamHash> createContentStreamHashes(InputStream stream, String... algorithm) throws IOException, NoSuchAlgorithmException
This method consumes the stream but doesn't close it.
stream - the streamalgorithm - the algorithmsIOExceptionNoSuchAlgorithmExceptionprotected static String byteArrayToHexString(byte[] bytes)
Copyright © 2009-2015 The Apache Software Foundation. All Rights Reserved.