From bb40ec4058433563c55916f7ad4da953e21d0e9b Mon Sep 17 00:00:00 2001
From: anttil <anttil>
Date: Tue, 13 Aug 2013 14:40:19 +0000
Subject: [PATCH] BIS-506 / SP-801:  Disable pathinfo crc checks. Add comments
 to new classes.

SVN: 29651
---
 .../server/plugins/standard/AbstractZipFileVerifier.java    | 2 ++
 .../dss/generic/server/plugins/standard/CrcProvider.java    | 2 ++
 .../DistributedPackagingDataSetFileOperationsManager.java   | 6 ++++--
 .../dss/generic/server/plugins/standard/ICrcProvider.java   | 2 ++
 .../server/plugins/standard/ZipFileIntegrityVerifier.java   | 2 ++
 .../plugins/standard/ZipFilePathInfoChecksumVerifier.java   | 2 ++
 6 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/AbstractZipFileVerifier.java b/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/AbstractZipFileVerifier.java
index b1993b8a04e..c94d291f178 100644
--- a/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/AbstractZipFileVerifier.java
+++ b/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/AbstractZipFileVerifier.java
@@ -27,6 +27,8 @@ import java.util.zip.CRC32;
 import de.schlichtherle.util.zip.ZipFile;
 
 /**
+ * Verifies a zip file.
+ * 
  * @author anttil
  */
 public abstract class AbstractZipFileVerifier implements IArchiveFileVerifier
diff --git a/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/CrcProvider.java b/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/CrcProvider.java
index 38ee81ca9dd..bcd8ef6e637 100644
--- a/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/CrcProvider.java
+++ b/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/CrcProvider.java
@@ -21,6 +21,8 @@ import java.util.Map;
 import ch.systemsx.cisd.openbis.dss.generic.server.DatabaseBasedDataSetPathInfoProvider;
 
 /**
+ * Provides a CRC32 checksum from pathinfo db for given file.
+ * 
  * @author anttil
  */
 public class CrcProvider implements ICrcProvider
diff --git a/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/DistributedPackagingDataSetFileOperationsManager.java b/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/DistributedPackagingDataSetFileOperationsManager.java
index 1dc1c0871e0..f984aca708c 100644
--- a/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/DistributedPackagingDataSetFileOperationsManager.java
+++ b/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/DistributedPackagingDataSetFileOperationsManager.java
@@ -168,8 +168,10 @@ public class DistributedPackagingDataSetFileOperationsManager implements IDataSe
                     dataSetPackager.close();
 
                     List<String> errors =
-                            verify(file, new ZipFileIntegrityVerifier(),
-                                    new ZipFilePathInfoChecksumVerifier(new CrcProvider(datasetDescription.getDataSetCode())));
+                            verify(file, new ZipFileIntegrityVerifier()/*
+                                                                        * , new ZipFilePathInfoChecksumVerifier(new
+                                                                        * CrcProvider(datasetDescription.getDataSetCode()))
+                                                                        */);
 
                     if (errors.size() > 0)
                     {
diff --git a/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/ICrcProvider.java b/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/ICrcProvider.java
index 6003ba4b8fc..51699f9a7a5 100644
--- a/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/ICrcProvider.java
+++ b/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/ICrcProvider.java
@@ -17,6 +17,8 @@
 package ch.systemsx.cisd.openbis.dss.generic.server.plugins.standard;
 
 /**
+ * Provides a CRC32 checksum for given file.
+ * 
  * @author anttil
  */
 public interface ICrcProvider
diff --git a/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/ZipFileIntegrityVerifier.java b/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/ZipFileIntegrityVerifier.java
index cde08ea3b82..3aac9141789 100644
--- a/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/ZipFileIntegrityVerifier.java
+++ b/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/ZipFileIntegrityVerifier.java
@@ -29,6 +29,8 @@ import de.schlichtherle.util.zip.ZipEntry;
 import de.schlichtherle.util.zip.ZipFile;
 
 /**
+ * Verifies integrity of a zip file by comparing its header checksums with real checksums of extracted files.
+ * 
  * @author anttil
  */
 public class ZipFileIntegrityVerifier extends AbstractZipFileVerifier
diff --git a/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/ZipFilePathInfoChecksumVerifier.java b/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/ZipFilePathInfoChecksumVerifier.java
index 92626ba00e7..fd68ad382f9 100644
--- a/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/ZipFilePathInfoChecksumVerifier.java
+++ b/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/ZipFilePathInfoChecksumVerifier.java
@@ -24,6 +24,8 @@ import de.schlichtherle.util.zip.ZipEntry;
 import de.schlichtherle.util.zip.ZipFile;
 
 /**
+ * Compares checksums in zip file headers to checksums from an outside source (such as pathinfo db)
+ * 
  * @author anttil
  */
 public class ZipFilePathInfoChecksumVerifier extends AbstractZipFileVerifier
-- 
GitLab