org.apache.jackrabbit.core.value
Class BinaryValueImpl

java.lang.Object
  extended by org.apache.jackrabbit.value.BaseValue
      extended by org.apache.jackrabbit.value.BinaryValue
          extended by org.apache.jackrabbit.core.value.BinaryValueImpl
All Implemented Interfaces:
Value, JackrabbitValue

public class BinaryValueImpl
extends BinaryValue
implements JackrabbitValue

Represents a binary value that is backed by a blob file value.


Field Summary
 
Fields inherited from class org.apache.jackrabbit.value.BinaryValue
TYPE
 
Fields inherited from class org.apache.jackrabbit.value.BaseValue
DEFAULT_ENCODING, stream, type
 
Method Summary
 String getContentIdentity()
          Get a unique identifier of the content of this value.
 
Methods inherited from class org.apache.jackrabbit.value.BinaryValue
equals, getInternalString, getStream, hashCode
 
Methods inherited from class org.apache.jackrabbit.value.BaseValue
getBoolean, getDate, getDouble, getLong, getString, getType, setStreamConsumed, setValueConsumed
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.jcr.Value
getBoolean, getDate, getDouble, getLong, getStream, getString, getType
 

Method Detail

getContentIdentity

public String getContentIdentity()
Get a unique identifier of the content of this value. Usually this is a message digest of the content (a cryptographically secure one-way hash). This allows to avoid processing large binary values multiple times.

This method returns null if the identifier is unknown. The identifier may not always be available, for example if the value has not yet been saved or processed. Once an identifier is available, it will never change because values are immutable.

If two values have the same identifier, the content of the value is guaranteed to be the same. However it is not guaranteed that two values with the same content will return the same identifier.

The identifier is opaque, meaning it can have any format and size, however it is at normally about 50 characters and at most 255 characters long. The string only contains Unicode code points from 32 to 127 (including).

Specified by:
getContentIdentity in interface JackrabbitValue
Returns:
the unique identifier or null


Copyright © 2004-2009 The Apache Software Foundation. All Rights Reserved.