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 java.lang.Object

Miscellaneous utility functions


Method Summary
static java.lang.String escape(java.lang.String path)
          Escapes a JCR path such that it can be used in a XPath query
static java.lang.String replace(java.lang.String string, java.lang.String target, java.lang.String replacement)
          Replace every occurrence of target in string with replacement.
static java.util.GregorianCalendar toCalendar(java.util.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 java.util.GregorianCalendar toCalendar(java.util.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 java.lang.String replace(java.lang.String string,
                                       java.lang.String target,
                                       java.lang.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 java.lang.String escape(java.lang.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.