You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@chemistry.apache.org by fm...@apache.org on 2014/03/24 14:32:31 UTC
svn commit: r1580847 - in
/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src:
main/java/org/apache/chemistry/opencmis/commons/impl/dataobjects/
test/java/org/apache/chemistry/opencmis/commons/impl/misc/
Author: fmui
Date: Mon Mar 24 13:32:30 2014
New Revision: 1580847
URL: http://svn.apache.org/r1580847
Log:
CMIS-770: minor content hash implementation corrections
Modified:
chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/dataobjects/ContentStreamHashImpl.java
chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/misc/ContentStreamHashTest.java
Modified: chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/dataobjects/ContentStreamHashImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/dataobjects/ContentStreamHashImpl.java?rev=1580847&r1=1580846&r2=1580847&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/dataobjects/ContentStreamHashImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/dataobjects/ContentStreamHashImpl.java Mon Mar 24 13:32:30 2014
@@ -45,12 +45,6 @@ public class ContentStreamHashImpl imple
private String hash = null;
/**
- * Constructs an object without values.
- */
- public ContentStreamHashImpl() {
- }
-
- /**
* Constructs an object from the {@code cmis:contentStreamHash} property
* value.
*
@@ -119,7 +113,7 @@ public class ContentStreamHashImpl imple
* the algorithms
* @return the list of content hashes
*/
- public static List<ContentStreamHash> createContentHashes(InputStream stream, String... algorithm)
+ public static List<ContentStreamHash> createContentStreamHashes(InputStream stream, String... algorithm)
throws IOException, NoSuchAlgorithmException {
if (stream == null) {
throw new IllegalArgumentException("Stream must be set!");
Modified: chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/misc/ContentStreamHashTest.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/misc/ContentStreamHashTest.java?rev=1580847&r1=1580846&r2=1580847&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/misc/ContentStreamHashTest.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/misc/ContentStreamHashTest.java Mon Mar 24 13:32:30 2014
@@ -61,8 +61,8 @@ public class ContentStreamHashTest {
byte[] content = IOUtils.toUTF8Bytes("Hello World!");
ByteArrayInputStream stream = new ByteArrayInputStream(content);
- ContentStreamHash hash = ContentStreamHashImpl.createContentHashes(stream, ContentStreamHashImpl.ALGORITHM_MD5)
- .get(0);
+ ContentStreamHash hash = ContentStreamHashImpl.createContentStreamHashes(stream,
+ ContentStreamHashImpl.ALGORITHM_MD5).get(0);
assertEquals(ContentStreamHashImpl.ALGORITHM_MD5, hash.getAlgorithm());
assertEquals("ed076287532e86365e841e92bfc50d8c", hash.getHash());
@@ -76,8 +76,8 @@ public class ContentStreamHashTest {
byte[] content = IOUtils.toUTF8Bytes("Hello World!");
ByteArrayInputStream stream = new ByteArrayInputStream(content);
- ContentStreamHash hash = ContentStreamHashImpl
- .createContentHashes(stream, ContentStreamHashImpl.ALGORITHM_SHA1).get(0);
+ ContentStreamHash hash = ContentStreamHashImpl.createContentStreamHashes(stream,
+ ContentStreamHashImpl.ALGORITHM_SHA1).get(0);
assertEquals(ContentStreamHashImpl.ALGORITHM_SHA1, hash.getAlgorithm());
assertEquals("2ef7bde608ce5404e97d5f042f95f89f1c232871", hash.getHash());
@@ -91,7 +91,7 @@ public class ContentStreamHashTest {
byte[] content = IOUtils.toUTF8Bytes("Hello World!");
ByteArrayInputStream stream = new ByteArrayInputStream(content);
- ContentStreamHash hash = ContentStreamHashImpl.createContentHashes(stream,
+ ContentStreamHash hash = ContentStreamHashImpl.createContentStreamHashes(stream,
ContentStreamHashImpl.ALGORITHM_SHA256).get(0);
assertEquals(ContentStreamHashImpl.ALGORITHM_SHA256, hash.getAlgorithm());
@@ -107,7 +107,7 @@ public class ContentStreamHashTest {
byte[] content = IOUtils.toUTF8Bytes("Hello World!");
ByteArrayInputStream stream = new ByteArrayInputStream(content);
- ContentStreamHash hash = ContentStreamHashImpl.createContentHashes(stream,
+ ContentStreamHash hash = ContentStreamHashImpl.createContentStreamHashes(stream,
ContentStreamHashImpl.ALGORITHM_SHA512).get(0);
assertEquals(ContentStreamHashImpl.ALGORITHM_SHA512, hash.getAlgorithm());
@@ -127,7 +127,7 @@ public class ContentStreamHashTest {
byte[] content = IOUtils.toUTF8Bytes("Hello World!");
ByteArrayInputStream stream = new ByteArrayInputStream(content);
- List<ContentStreamHash> hashes = ContentStreamHashImpl.createContentHashes(stream,
+ List<ContentStreamHash> hashes = ContentStreamHashImpl.createContentStreamHashes(stream,
ContentStreamHashImpl.ALGORITHM_SHA1, ContentStreamHashImpl.ALGORITHM_SHA256,
ContentStreamHashImpl.ALGORITHM_SHA512);