private void findMarkers ( String url , String target ) { final char [ ] data = url . toCharArray ( ) ; // we only care about the last path segment so find that first int i = 0 ; int lastSlash = 0 ; for ( ; i < data . length ; i ++ ) { if ( ' ' == data [ i ] ) { lastSlash = i ; } else if ( ' ' == data [ i ] ) { this . queryMarker = i ; break ; // out of loop since query data is after the path } } // now check for the id marker and/or fragments for the last segment for ( i = lastSlash ; i < data . length ; i ++ ) { if ( i == this . queryMarker ) { // no fragments or segment parameters were found break ; } else if ( ' ' == data [ i ] ) { // found a "#fragment" at the end of the path segment this . fragmentMarker = i ; break ; } else if ( ' ' == data [ i ] ) { // found a segment parameter block (would appear before the // optional fragment or query data) this . paramMarker = i ; if ( url . regionMatches ( i , target , 0 , target . length ( ) ) ) { this . idMarker = i ; } } } }
Scan the data for various markers including the provided session id target .