com.hp.hpl.deli
Class DeliUtil

java.lang.Object
  extended bycom.hp.hpl.deli.DeliUtil

public class DeliUtil
extends java.lang.Object


Constructor Summary
DeliUtil()
           
 
Method Summary
static java.lang.String calculateProfileDiffDigest(java.lang.String profileDiff, boolean normaliseWhitespaceInProfileDiff)
          This method calculates a profile-diff-digest.
static java.lang.String removeWhitespaces(java.lang.String diff)
          This method removes whitespaces in the profile-diff according to the following two rules: Leading and trailing white spaces are eliminated (white space as defined in RFC 2616 section 2.2) All non-trailing or non-leading linear white space (LWS) contained in the profile description, including line folding of multiple HTTP header lines, is replaced with one single space (SP) character.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DeliUtil

public DeliUtil()
Method Detail

calculateProfileDiffDigest

public static java.lang.String calculateProfileDiffDigest(java.lang.String profileDiff,
                                                          boolean normaliseWhitespaceInProfileDiff)
                                                   throws java.lang.Exception
This method calculates a profile-diff-digest. It does this by taking a profile-diff as a string and calculating the corresponding profile-diff-digest by normalising any whitespace, applying the MD5 algorithm and then converting this to a string using BASE64 encoding.

Parameters:
profileDiff - The profile-diff.
normaliseWhitespaceInProfileDiff - Turn whitespace normalising on or off.
Returns:
The profile-diff-digest.
Throws:
java.lang.Exception

removeWhitespaces

public static java.lang.String removeWhitespaces(java.lang.String diff)
This method removes whitespaces in the profile-diff according to the following two rules:

Parameters:
diff - The profile-diff.
Returns:
The normalised profile-diff.