org.jwat.warc
Class WarcDigest

java.lang.Object
  extended by org.jwat.common.Digest
      extended by org.jwat.warc.WarcDigest

public class WarcDigest
extends Digest

This class represents the parsed and format validated information provided from a WARC digest header value.

Author:
nicl

Field Summary
 
Fields inherited from class org.jwat.common.Digest
algorithm, digestAlgoLengthache, digestBytes, digestString, encoding
 
Constructor Summary
protected WarcDigest()
          Package level constructor.
protected WarcDigest(String algorithm, String digestValue)
          Construct an object with the supplied parameters.
 
Method Summary
static WarcDigest createWarcDigest(String algorithm, byte[] digestBytes, String encoding, String digestValue)
          Create an object with the supplied parameters.
static WarcDigest parseWarcDigest(String labelledDigest)
          Parse and validate the format of a WARC digest header value.
 String toString()
          Returns a header representation of the class state.
 String toStringFull()
           
 
Methods inherited from class org.jwat.common.Digest
digestAlgorithmLength, equals, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WarcDigest

protected WarcDigest()
Package level constructor.


WarcDigest

protected WarcDigest(String algorithm,
                     String digestValue)
Construct an object with the supplied parameters.

Parameters:
algorithm - digest algorithm
digestValue - digest value in encoded format. (base16/32/64)
Method Detail

parseWarcDigest

public static WarcDigest parseWarcDigest(String labelledDigest)
Parse and validate the format of a WARC digest header value.

Parameters:
labelledDigest - WARC digest header value
Returns:
WarcDigest object or null

createWarcDigest

public static WarcDigest createWarcDigest(String algorithm,
                                          byte[] digestBytes,
                                          String encoding,
                                          String digestValue)
Create an object with the supplied parameters.

Parameters:
algorithm - digest algorithm
digestBytes - digest in byte form
encoding - encoding used
digestValue - digest value in encoded form.

toString

public String toString()
Returns a header representation of the class state.

Overrides:
toString in class Object
Returns:
header representation of the class state

toStringFull

public String toStringFull()


Copyright © 2011-2012. All Rights Reserved.