question: public String [ ] split ( String res ) { String protocol = "" ; int doubleD = res . indexOf ( delimiter + delimiter ) ; if ( doubleD != - 1 ) { protocol = res . substring ( 0 , doubleD + 2 ) ; res = res . substring ( doubleD + 2 ) ; } StringTokenizer st = new StringTokenizer ( res , delimiter ) ; int n = st . countTokens ( ) ; String [ ] retVal = new String [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { retVal [ i ] = st . nextToken ( ) ; } retVal [ 0 ] = protocol + retVal [ 0 ] ; if ( res . startsWith ( delimiter ) ) { retVal [ 0 ] = retVal [ 0 ] + delimiter ; } if ( res . endsWith ( delimiter ) ) { retVal [ n - 1 ] = retVal [ n - 1 ] + delimiter ; } return retVal ; }
target:  Splits the given resource name.