com.wewebu.ow.server.util
Class OwObjectIDCodeUtil

java.lang.Object
  extended by com.wewebu.ow.server.util.OwObjectIDCodeUtil

public class OwObjectIDCodeUtil
extends Object

Utility class for ObjectID de- and encoding.
The ID (string) of an object can be used for path definitions, because the object name must not be unique, therefore the object ID should not contain slashes. This utility class will replace in the given ID all occurrence of slashes '/' ([/]) with a broken bar '|' ([|]).

Alfresco Workdesk
Copyright (c) Alfresco Software, Inc.
All rights reserved.

For licensing information read the license.txt file or
go to: http://wiki.alfresco.com

Since:
3.1.0.0

Field Summary
static String ENCODE_PLACEHOLDER
          Placeholder which will be add to the ID instead of the PATH_SEPARATOR
static char ENCODE_PLACEHOLDER_CHAR
          char representation of the ENCODE_PLACEHOLDER
static String PATH_SEPARATOR
          Separator of the path, should not be contained in objectID definition.
static char PATH_SEPARATOR_CHAR
          char representation of the PATH_SEPARATOR
 
Constructor Summary
OwObjectIDCodeUtil()
           
 
Method Summary
static String decode(String objectID_p)
          Decode the given ID, by replacing the ENCODE_PLACEHOLDER_CHAR with slashes (PATH_SEPARATOR_CHAR).
static String encode(String objectID_p)
          Encode the given ID, by replacing all existing slashes in the objectID_p String with the ENCODE_PLACEHOLDER_CHAR.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PATH_SEPARATOR

public static final String PATH_SEPARATOR
Separator of the path, should not be contained in objectID definition.

See Also:
Constant Field Values

ENCODE_PLACEHOLDER

public static final String ENCODE_PLACEHOLDER
Placeholder which will be add to the ID instead of the PATH_SEPARATOR

See Also:
Constant Field Values

PATH_SEPARATOR_CHAR

public static final char PATH_SEPARATOR_CHAR
char representation of the PATH_SEPARATOR

See Also:
Constant Field Values

ENCODE_PLACEHOLDER_CHAR

public static final char ENCODE_PLACEHOLDER_CHAR
char representation of the ENCODE_PLACEHOLDER

See Also:
Constant Field Values
Constructor Detail

OwObjectIDCodeUtil

public OwObjectIDCodeUtil()
Method Detail

encode

public static String encode(String objectID_p)
Encode the given ID, by replacing all existing slashes in the objectID_p String with the ENCODE_PLACEHOLDER_CHAR.

Parameters:
objectID_p - String which may contain slashes
Returns:
String without any occurrence of slashes

decode

public static String decode(String objectID_p)
Decode the given ID, by replacing the ENCODE_PLACEHOLDER_CHAR with slashes (PATH_SEPARATOR_CHAR).

Parameters:
objectID_p - String which should be decoded
Returns:
String where ENCODE_PLACEHOLDER_CHAR are replaced with slashes


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.