/** * @see net.sourceforge.squirrel_sql.client.update.UpdateUtil#getCheckSum(java.io.File) */ public long getCheckSum(FileWrapper f) { String absPath = f.getAbsolutePath(); Long result = -1L; if (fileChecksumMap.containsKey(absPath)) { result = fileChecksumMap.get(absPath); } else { try { result = _iou.getCheckSum(f); } catch (IOException e) { s_log.error("getCheckSum: failed to compute the checksum for file (" + f.getAbsolutePath() + "): " + e.getMessage(), e); } // -1 is stored if the checksum operation failed. This will ensure that comparison with any other // file's checksum will be different - even if they happen to be the same file. fileChecksumMap.put(absPath, result); } return result; }
/** * @see net.sourceforge.squirrel_sql.client.update.UpdateUtil#getCheckSum(java.io.File) */ public long getCheckSum(FileWrapper f) { String absPath = f.getAbsolutePath(); Long result = -1L; if (fileChecksumMap.containsKey(absPath)) { result = fileChecksumMap.get(absPath); } else { try { result = _iou.getCheckSum(f); } catch (IOException e) { s_log.error("getCheckSum: failed to compute the checksum for file (" + f.getAbsolutePath() + "): " + e.getMessage(), e); } // -1 is stored if the checksum operation failed. This will ensure that comparison with any other // file's checksum will be different - even if they happen to be the same file. fileChecksumMap.put(absPath, result); } return result; }
artifact.setVersion(version); artifact.setSize(a.length()); artifact.setChecksum(_iou.getCheckSum(a)); module.addArtifact(artifact);
artifact.setVersion(version); artifact.setSize(a.length()); artifact.setChecksum(_iou.getCheckSum(a)); module.addArtifact(artifact);