Project Home
Project Home
Trackers
Trackers
Source Code
Source Code
Build & Test
Build & Test
File Releases
File Releases
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Reports
Reports
Project Information
Project Info
Artifact artf2645 : Hash calculation in ProvideAndRegisterSet wrong Print Preview
Tracker:Issue tracker
Title:Hash calculation in ProvideAndRegisterSet wrong
Description:
See fixed implementation:

Index: ProvideAndRegisterDocumentSet.java
===================================================================
--- ProvideAndRegisterDocumentSet.java	(revision 745)
+++ ProvideAndRegisterDocumentSet.java	(working copy)
@@ -29,6 +29,7 @@
 
 import javax.activation.DataHandler;
 import javax.xml.namespace.QName;
+import javax.mail.util.ByteArrayDataSource;
 
 import org.apache.axiom.om.OMAttribute;
 import org.apache.axiom.om.OMElement;
@@ -476,6 +477,7 @@
 		XdsRepositoryItem item = XdsFactory.getXdsReposiotryItem();
 		item.setDocumentUniqueId(uid);
 		item.setDataHandler(dataHandler);
 		
 		String mime_type = extrinsic_object.getAttributeValue(MetadataSupport.mime_type_qname);
 
@@ -551,7 +553,9 @@
 		if (mime_type == null || mime_type.equals(""))
 			throw new MetadataException("ExtrinsicObject " + id + " does not have a mimeType");
 
-        DataHandler dataHandler = new DataHandler(new String(bytes), mime_type);
+        // DataHandler dataHandler = new DataHandler(new String(bytes), mime_type);
+        ByteArrayDataSource ds = new ByteArrayDataSource(bytes, mime_type);
+		DataHandler dataHandler = new DataHandler(ds);
 
 		String size_str = Integer.toString(bytes.length);
 		String hash_value = null;

See dev post:
https://www.projects.openhealthtools.org/sf/discussion/do/listPosts/projects.openxds/discussion.forum1109.topc11374;
jsessionid=ABD109BC58E9117993762BE60707C383?pageSize=-1#post_post19505
Submitted By:Wenzhi Li(deleted)
Submitted On:04/14/2011 6:10 AM PDT
Last Modified:04/14/2011 6:23 AM PDT

Active Tab Status / Comments Inactive Tab - left sideChange Log Inactive Tab - left sideAssociations Inactive Tab - left sideDependencies Inactive Tab - left sideAttachmentsInactive Tab - right side  
RESOLVED
FIXED
openxds
www
All
All
current
3
DEFECT
None
Planning Folder:*None
Comments
#2Wenzhi Li(deleted): 04/14/2011 6:23 AM PDT
 Comment:
Fixed as provided by the original issue reporter.
 Action:Update
Resolution set to FIXED
Assigned To set to Wenzhi Li(deleted)
Status changed from NEW to RESOLVED
#1Wenzhi Li(deleted): 04/14/2011 6:10 AM PDT
 Action:Create

Button Divider
< Previous
Next >