Class Utils

java.lang.Object
org.exoplatform.portal.mop.user.Utils

public class Utils extends Object
A set of utils for this package.
Author:
Julien Viet
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static String[]
    Parse the path with the following algorithm: <ul> <li>The one char <code>/</code> string returns the null array</li> <li>Any leading <code>/<code> char is ommited</li> <li>Any trailing </code>/</code> chars are ommited</li> <li>All the substrings obtained by slicing the remaining string by the <code>/</code> char are returned as an array, even the empty strings</li> </ul> <p> Note that this is a reimplementation of a previous method that was using regex splitting, this reimplementation was done in order to minimize the created object count in mind and attempt to create the minimum required.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Utils

      public Utils()
  • Method Details

    • parsePath

      public static String[] parsePath(String path) throws NullPointerException
      Parse the path with the following algorithm: <ul> <li>The one char <code>/</code> string returns the null array</li> <li>Any leading <code>/<code> char is ommited</li> <li>Any trailing </code>/</code> chars are ommited</li> <li>All the substrings obtained by slicing the remaining string by the <code>/</code> char are returned as an array, even the empty strings</li> </ul> <p> Note that this is a reimplementation of a previous method that was using regex splitting, this reimplementation was done in order to minimize the created object count in mind and attempt to create the minimum required. </p>
      Parameters:
      path - the path
      Returns:
      the parse result
      Throws:
      NullPointerException - if the path argument is null