com.bea.content.cmis.rest.converters
Class BinaryPropertyHelper

java.lang.Object
  extended by com.bea.content.cmis.rest.converters.BinaryPropertyHelper

public class BinaryPropertyHelper
extends Object

Helper methods to consistently identify the one binary property exposed via cmis. The binary property is: The primary property, if that property is of type BINARY. Else, the first property definition with type BINARY. If there is no BINARY primary property and the first property found of type BINARY is null, then that is what is returned (it does not try to find the next BINARY property that is not null). If dealing w/ CMIS REST binaries, it is suggested to set expected BINARY property as primary on the node.


Method Summary
static byte[] base64Decode(String encoded)
          Base64 decode a String
static Property getBinaryProperty(Node node)
          Find the binary property for the node.
static PropertyDefinition getBinaryPropertyDefinition(ObjectClass oc)
          Find the binary property definition for the object class.
static boolean hasBinaryPropertyDefinition(ObjectClass oc)
           
static boolean isPrimaryBinaryProperty(ObjectClass oc, Property prop)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getBinaryProperty

public static Property getBinaryProperty(Node node)
                                  throws RepositoryException
Find the binary property for the node. Returns the primary property if it is a binary. Otherwise retrns the first property that is a binary type.

Parameters
node -
Returns
the binary property, or null if none found.
Throws
RepositoryException

hasBinaryPropertyDefinition

public static boolean hasBinaryPropertyDefinition(ObjectClass oc)

getBinaryPropertyDefinition

public static PropertyDefinition getBinaryPropertyDefinition(ObjectClass oc)
                                                      throws AuthorizationException
Find the binary property definition for the object class. Returns the primary property if it is binary. Otherwise retrns the first property definition that is a binary type.

Parameters
oc -
Returns
the binary property definition, or null if none found.
Throws
AuthorizationException

isPrimaryBinaryProperty

public static boolean isPrimaryBinaryProperty(ObjectClass oc,
                                              Property prop)

base64Decode

public static byte[] base64Decode(String encoded)
                           throws RepositoryException
Base64 decode a String

Parameters
encoded - the String to decode
Returns
decoded byte array
Throws
RepositoryException


Copyright © 2011, Oracle. All rights reserved.