ro.isdc.wro.model.resource.support.hash
Class AbstractDigesterHashStrategy
java.lang.Object
ro.isdc.wro.model.resource.support.hash.AbstractDigesterHashStrategy
- All Implemented Interfaces:
- HashBuilder, HashStrategy
- Direct Known Subclasses:
- MD5HashStrategy, SHA1HashStrategy
public abstract class AbstractDigesterHashStrategy
- extends Object
- implements HashStrategy
Uses abstract digester for creating a hash.
- Author:
- Alex Objelean
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractDigesterHashStrategy
public AbstractDigesterHashStrategy()
getHash
public String getHash(InputStream input)
throws IOException
-
- Specified by:
getHash
in interface HashBuilder
- Parameters:
input
- to digest.
- Returns:
- the hash of the content.
- Throws:
IOException
- if there was an error during reading the stream content.
newMessageDigest
protected abstract MessageDigest newMessageDigest()
throws NoSuchAlgorithmException
- Returns:
- MessageDigest used for hashing.
- Throws:
NoSuchAlgorithmException
Copyright © 2008-2013. All Rights Reserved.