public static String findRootInstancePath ( String scopedInstancePath ) { String result ; if ( Utils . isEmptyOrWhitespaces ( scopedInstancePath ) ) { // Do not return null result = "" ; } else if ( scopedInstancePath . contains ( "/" ) ) { // Be as flexible as possible with paths String s = scopedInstancePath . replaceFirst ( "^/*" , "" ) ; int index = s . indexOf ( ' ' ) ; result = index > 0 ? s . substring ( 0 , index ) : s ; } else { // Assumed to be a root instance name result = scopedInstancePath ; } return result ; }
Finds the root instance s path from another instance path .