Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2010-07-14 13:21:30 -0400
committerEike Stepper2010-07-14 13:21:30 -0400
commitee54d9124607a8de87bdfa505ee2a4a047b55c13 (patch)
treeaf8319d24775a671eb6e2d5d600f9001958de8ef /releng/org.eclipse.emf.cdo.releng.version.digest
parentbc778c17259473949037b87ce7631516bcb10c79 (diff)
downloadcdo-ee54d9124607a8de87bdfa505ee2a4a047b55c13.tar.gz
cdo-ee54d9124607a8de87bdfa505ee2a4a047b55c13.tar.xz
cdo-ee54d9124607a8de87bdfa505ee2a4a047b55c13.zip
ignore CR/LF for digests
Diffstat (limited to 'releng/org.eclipse.emf.cdo.releng.version.digest')
-rw-r--r--releng/org.eclipse.emf.cdo.releng.version.digest/src/org/eclipse/emf/cdo/releng/version/digest/DigestValidator.java37
1 files changed, 36 insertions, 1 deletions
diff --git a/releng/org.eclipse.emf.cdo.releng.version.digest/src/org/eclipse/emf/cdo/releng/version/digest/DigestValidator.java b/releng/org.eclipse.emf.cdo.releng.version.digest/src/org/eclipse/emf/cdo/releng/version/digest/DigestValidator.java
index d4168e4261..ff6d90b317 100644
--- a/releng/org.eclipse.emf.cdo.releng.version.digest/src/org/eclipse/emf/cdo/releng/version/digest/DigestValidator.java
+++ b/releng/org.eclipse.emf.cdo.releng.version.digest/src/org/eclipse/emf/cdo/releng/version/digest/DigestValidator.java
@@ -277,7 +277,42 @@ public class DigestValidator extends VersionValidator
try
{
MessageDigest digest = MessageDigest.getInstance("SHA-1");
- stream = new DigestInputStream(file.getContents(), digest);
+ stream = new DigestInputStream(file.getContents(), digest)
+ {
+ @Override
+ public int read() throws IOException
+ {
+ int read;
+ while ((read = super.read()) == 10 || read == 13)
+ {
+ // Read again
+ }
+
+ return read;
+ }
+
+ @Override
+ public int read(byte[] b, int off, int len) throws IOException
+ {
+ int read = super.read(b, off, len);
+ for (int i = off; i < off + read; i++)
+ {
+ byte c = b[i];
+ if (c == 10 || c == 13)
+ {
+ if (i + 1 < off + read)
+ {
+ System.arraycopy(b, i + 1, b, i, read - i - 1);
+ --i;
+ }
+
+ --read;
+ }
+ }
+
+ return read;
+ }
+ };
while (stream.read(BUFFER) != -1)
{

Back to the top