Merge pull request #161 from bsinno/feature_add_targettoken_to_dmf

Add target security token to DMF update message
This commit is contained in:
Michael Hirsch
2016-05-09 13:07:51 +02:00
33 changed files with 618 additions and 289 deletions

View File

@@ -200,9 +200,9 @@ public class ArtifactStore implements ArtifactRepository {
String sha1Hash;
// compute digest
final MessageDigest md = MessageDigest.getInstance("SHA-1");
final DigestOutputStream dos = new DigestOutputStream(os, md);
ByteStreams.copy(stream, dos);
dos.close();
try (final DigestOutputStream dos = new DigestOutputStream(os, md)) {
ByteStreams.copy(stream, dos);
}
sha1Hash = BaseEncoding.base16().lowerCase().encode(md.digest());
if (providedSHA1Sum != null && !providedSHA1Sum.equalsIgnoreCase(sha1Hash)) {
throw new HashNotMatchException(