@Override public CheckSum generateCheckSum() { String file = getFile(); if (relativeToChangelogFile != null && relativeToChangelogFile) { if (getChangeSet().getFilePath().contains("/")) { file = getChangeSet().getFilePath().replaceFirst("/[^/]*$", "") + "/" + getFile(); } } InputStream stream = null; try { stream = getResourceAccessor().getResourceAsStream(file); if (stream == null) { throw new RuntimeException(file + " could not be found"); } return CheckSum.compute(stream); } catch (IOException e) { throw new RuntimeException(e); } finally { if (stream != null) { try { stream.close(); } catch (IOException e) {; } } } }
public CheckSum generateCheckSum() { StringBuffer stringToMD5 = new StringBuffer(); for (Change change : getChanges()) { stringToMD5.append(change.generateCheckSum()).append(":"); } for (SqlVisitor visitor : this.getSqlVisitors()) { stringToMD5.append(visitor.generateCheckSum()).append(";"); } return CheckSum.compute(stringToMD5.toString()); }
public CheckSum generateCheckSum() { return CheckSum.compute(new StringChangeLogSerializer().serialize(this)); }