Jump to ID:
  Project: openxds  [Show Path]

Project Home

Tracker

Documents

Source Code

Discussions

Reports

File Releases

Wiki

Project Info
Artifact artf2645 : Hash calculation in ProvideAndRegisterSet wrong
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

Status / Comments Change Log Associations Dependencies Attachments  
Status  
Category: *
Status:* RESOLVED
Resolution: * FIXED
Component:* openxds
Subcomponent:* www
Platform:* All
OS:* All
Version:* current
Priority: * 3
Issue type:* DEFECT
Target milestone: *
Assigned To: * None
QA Contact: *
URL: *
Status whiteboard: *
Keywords: *
Planning Folder: * None
Comments
#2 – Wenzhi 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
#1 – Wenzhi Li(deleted): 04/14/2011 6:10 AM PDT
  Action: Create

 
 
 
< Previous
 
 
Next >