Open GoogleCodeExporter opened 9 years ago
Also it's better to use InputStream to generate hash value.
this.hash = getSha1Hash(FileUtils.readFileToString(file));
-->
InputStream is = null;
try {
is = new FileInputStream(file);
this.hash = DigestUtils.shaHex(is);
} catch (IOException e) {
throw e;
} finally {
IOUtils.closeQuietly(is);
}
Original comment by teru.mor...@gmail.com
on 1 Mar 2012 at 10:00
xd-common-1.0.1 also has the same issue.
Original comment by teru.mor...@gmail.com
on 1 Mar 2012 at 10:17
Adding a patch, see xd-common-patch-180.txt
Summary of changes:
- xd-common/pom.xml
-- Upgraded commons-codec to 1.7 (consider 1.9, but I know 1.7 works)
- xd-common/src/main/java/org/nhindirect/xd/common/DirectDocument2.java
-- Both getSha1Hash methods now just call commons codec's DigestUtils
- xd-common/src/main/java/org/nhindirect/xd/common/XdmPackage.java
-- Don't convert to a String here, just use the bytes
Original comment by marc...@mirthcorp.com
on 6 Oct 2014 at 6:26
Attachments:
Original issue reported on code.google.com by
teru.mor...@gmail.com
on 1 Mar 2012 at 9:57