private String getHash ( ) { try { Node contentNode = getContextNode ( ) ; Property data = contentNode . getProperty ( Property . JCR_DATA ) ; Binary bin = ( Binary ) data . getBinary ( ) ; return String . format ( "{%s}%s" , HASH_ALGORITHM , bin . getHexHash ( ) ) ; } catch ( RepositoryException e ) { return "" ; } }
Get the hexadecimal form of the SHA - 1 hash of the contents .