// Ok, if we got this far we need to calculate the content digest.
// Get the regex
String regex = getStripRegex();
// Get a replay of the document character seq.
ReplayCharSequence cs = null;
try {
cs = curi.getRecorder().getContentReplayCharSequence();
// Create a MessageDigest
MessageDigest digest = null;
try {
digest = MessageDigest.getInstance(SHA1);
} catch (NoSuchAlgorithmException e1) {
e1.printStackTrace();
return;
}
digest.reset();
String s = null;
if (StringUtils.isEmpty(regex)) {
s = cs.toString();
} else {
// Process the document
Matcher m = TextUtils.getMatcher(regex, cs);
s = m.replaceAll(" ");
TextUtils.recycleMatcher(m);