org.apache.chemistry.opencmis.jcr.util
Class Util

java.lang.Object
  extended by org.apache.chemistry.opencmis.jcr.util.Util

public final class Util
extends Object

Miscellaneous utility functions


Method Summary
static String escape(String path)
          Escapes a JCR path such that it can be used in a XPath query
static String replace(String string, String target, String replacement)
          Replace every occurrence of target in string with replacement.
static GregorianCalendar toCalendar(Calendar date)
          Convert from Calendar to a GregorianCalendar.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

toCalendar

public static GregorianCalendar toCalendar(Calendar date)
Convert from Calendar to a GregorianCalendar.

Parameters:
date -
Returns:
date if it is an instance of GregorianCalendar. Otherwise a new GregorianCalendar instance for date.

replace

public static String replace(String string,
                             String target,
                             String replacement)
Replace every occurrence of target in string with replacement.

Parameters:
string - string to do replacement on
target - string to search for
replacement - string to replace with
Returns:
string with replacing done

escape

public static String escape(String path)
Escapes a JCR path such that it can be used in a XPath query

Parameters:
path -
Returns:
escaped path


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