[ https://issues.apache.org/jira/browse/JCR-1892?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12661638#action_12661638 ]
Jukka Zitting commented on JCR-1892: ------------------------------------ Good stuff! Some comments: * Should we set some expectations (not necessarily fixed limits) about the size of the content identity string? With the current definition the implementation could simply return the base64 encoding of the entire binary value! * Do we need the DataStore.hasRecord() method? If we use getRecord() directly we wouldn't need to worry about race conditions with the garbage collection. * In BinaryValueImpl.getContentIdentity() I'd use blob.getDataIdentifier().toString() (with appropriate null guards) to avoid surprises if we ever decide to make blob.toString() more expressive for debug purposes. * I wouldn't call getContentIdentity() internally in jackrabbit-core as we already have access to the DataIdentifier in the source value. Also, a malicious user could have passed in their own subclass that overrides getContentIdentity(). > Unique ID for org.apache.jackrabbit.value.BinaryValue > ----------------------------------------------------- > > Key: JCR-1892 > URL: https://issues.apache.org/jira/browse/JCR-1892 > Project: Jackrabbit > Issue Type: New Feature > Components: jackrabbit-jcr-commons > Reporter: Thomas Mueller > Assignee: Thomas Mueller > Attachments: JackrabbitValue-api.patch, JackrabbitValue-core.patch > > > BinaryValue should have a method get the unique identifier (if one is > available). That way an application may not have to read the stream if that > value is already processed. > When the DataStore is used, a unique identifier is available, so probably > this feature is quite simple to implement. > See also http://www.nabble.com/Workspace.copy()-Question-...-td20435164.html > (but please don't reply to this thread from now on - instead add comments to > this issue). > Another feature is getFileName() to get the file name if it is stored in the > file system. This method may need a security mechanism, for example > getFileName(Session s) so that the system can check it. In any case the file > should not be modified, but maybe knowing the file name is already too > dangerous in some cases. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.