Closed mbowen000 closed 10 years ago
@mbowen000 - if you're going to mark this high priority then it needs to have an HPI 2.2 milestone and someone assigned. Please do that or set the milestone appropriately and remove the High Priority label.
Contentless objects now return a 204 No Content exception in OC.
Revision: 9252 Author: mblum Date: 2014-07-21 09:11:35.206911 fix for github issue #22: https://github.com/tsgrp/OpenContent/issues/22
M /webservices/trunk/SourceCode/OpenContent/modules/tsg/1.core/src/com/tsgrp/opencontent/core/content/RESTContent.java A /webservices/trunk/SourceCode/OpenContent/projects/tsg/hpiDctm/run-oc-jetty.sh A /webservices/trunk/SourceCode/OpenContent/projects/tsg/wizardDctm/run-oc-jetty.sh M /webservices/trunk/SourceCode/OpenContent/modules/tsg/2.filesystem/src/com/tsgrp/opencontent/filesystem/content/FilesystemContentImpl.java M /webservices/trunk/SourceCode/OpenContent/modules/tsg/1.core-client/src/main/java/com/tsgrp/opencontent/core/content/enhanced/model/EnhancedObjectContent.java A /webservices/trunk/SourceCode/OpenContent/projects/clients/gallagher-bassett-risx/build-CAMBRIDGE.properties M /webservices/trunk/SourceCode/OpenContent/modules/tsg/1.core/src/com/tsgrp/opencontent/core/util/OCUtil.java A /webservices/trunk/SourceCode/OpenContent/projects/tsg/wizardDctm/build-CAMBRIDGE.properties
The EnhancedObjectContent class contains a property called contentString that stores a String representation of the objects contents. Needless to say, this is an inefficient use of memory - especially because the String representation could potentially be 100-400% larger than the original content size! (http://www.javaworld.com/article/2077496/testing-debugging/java-tip-130--do-you-know-your-data-size-.html)
The only known usages of this property are in RESTContent and some older FileSystemImpl calls that are likely deprecated. In RESTContent, the String is used to test if the object has content:
This is junk. We should be reading if the contentStream for its first few bytes or using some better tested approach to determine if there is content on the object. Not storing the whole file as a String. That is just silly. There is also a setter for this property in RESTContent which I would imagine should not be used either.