use of liquibase.io.EmptyLineAndCommentSkippingInputStream in project liquibase by liquibase.
the class LoadDataChange method generateCheckSum.
@Override
public CheckSum generateCheckSum() {
InputStream stream = null;
try {
stream = Scope.getCurrentScope().getResourceAccessor().openStream(getRelativeTo(), file);
if (stream == null) {
throw new UnexpectedLiquibaseException(String.format(coreBundle.getString("file.not.found"), file));
}
stream = new EmptyLineAndCommentSkippingInputStream(stream, commentLineStartsWith);
return CheckSum.compute(getTableName() + ":" + CheckSum.compute(stream, /*standardizeLineEndings*/
true));
} catch (IOException e) {
throw new UnexpectedLiquibaseException(e);
} finally {
if (stream != null) {
try {
stream.close();
} catch (IOException ignore) {
// Do nothing
}
}
}
}
Aggregations