@ Override public PathImpl lookupImpl ( String userPath , Map < String , Object > newAttributes , boolean isAllowRoot ) { String newPath ; if ( userPath == null ) return _root . fsWalk ( getPath ( ) , newAttributes , "/" ) ; int length = userPath . length ( ) ; int colon = userPath . indexOf ( ' ' ) ; int slash = userPath . indexOf ( ' ' ) ; int query = userPath . indexOf ( ' ' ) ; // parent handles scheme:xxx if ( colon != - 1 && ( colon < slash || slash == - 1 ) ) return super . lookupImpl ( userPath , newAttributes , isAllowRoot ) ; // //hostname if ( slash == 0 && length > 1 && userPath . charAt ( 1 ) == ' ' ) return schemeWalk ( userPath , newAttributes , userPath , 0 ) ; // /path else if ( slash == 0 ) { String queryString = "" ; if ( query >= 0 ) { queryString = userPath . substring ( query ) ; userPath = userPath . substring ( 0 , query ) ; } newPath = normalizePath ( "/" , userPath , 0 , ' ' ) ; if ( query >= 0 ) newPath += queryString ; } // path else { String queryString = "" ; if ( query >= 0 ) { queryString = userPath . substring ( query ) ; userPath = userPath . substring ( 0 , query ) ; } newPath = normalizePath ( _pathname , userPath , 0 , ' ' ) ; if ( query >= 0 ) newPath += queryString ; } // XXX: does missing root here cause problems with restrictions? return _root . fsWalk ( userPath , newAttributes , newPath ) ; }
Overrides the default lookup to parse the host and port before parsing the path .