@Override public PathImpl schemeWalk(String userPath,Map<String,Object> attributes,String uri,int offset){
  int length=uri.length();
  if (length < 2 + offset || uri.charAt(offset) != '/' || uri.charAt(offset + 1) != '/')   throw new RuntimeException(L.l("bad scheme in `{0}'",uri));
  CharBuffer buf=CharBuffer.allocate();
  int i=2 + offset;
  int ch=0;
  boolean isInBrace=false;
  for (; i < length && ((ch=uri.charAt(i)) != ':' || isInBrace) && ch != '/' && ch != '?'; i++) {
    buf.append((char)ch);
    if (ch == '[')     isInBrace=true;
 else     if (ch == ']')     isInBrace=false;
  }
  String host=buf.close();
  if (host.length() == 0)   throw new RuntimeException(L.l("bad host in `{0}'",uri));
  int port=0;
  if (ch == ':') {
    for (i++; i < length && (ch=uri.charAt(i)) >= '0' && ch <= '9'; i++) {
      port=10 * port + uri.charAt(i) - '0';
    }
  }
  if (port == 0)   port=80;
  HttpPath root=create(host,port);
  return root.fsWalk(userPath,attributes,uri.substring(i));
}

@ Override public PathImpl schemeWalk ( String userPath , Map < String , Object > attributes , String uri , int offset ) { int length = uri . length ( ) ; if ( length < 2 + offset || uri . charAt ( offset ) != '/' || uri . charAt ( offset + 1 ) != '/' ) throw new RuntimeException ( L . l ( "bad scheme in `{0}'" , uri ) ) ; CharBuffer buf = CharBuffer . allocate ( ) ; int i = 2 + offset ; int ch = 0 ; boolean isInBrace = false ; for ( ; i < length && ( ( ch = uri . charAt ( i ) ) != ':' || isInBrace ) && ch != '/' && ch != '?' ; i ++ ) { buf . append ( ( char ) ch ) ; if ( ch == '[' ) isInBrace = true ; else if ( ch == ']' ) isInBrace = false ; } String host = buf . close ( ) ; if ( host . length ( ) == 0 ) throw new RuntimeException ( L . l ( "bad host in `{0}'" , uri ) ) ; int port = 0 ; if ( ch == ':' ) { for ( i ++ ; i < length && ( ch = uri . charAt ( i ) ) >= '0' && ch <= '9' ; i ++ ) { port = 10 * port + uri . charAt ( i ) - '0' ; } } if ( port == 0 ) port = 80 ; HttpPath root = create ( host , port ) ; return root . fsWalk ( userPath , attributes , uri . substring ( i ) ) ; }
walk down the path starting from the portion immediately following the scheme . i . e . schemewalk is responsible for parsing the host and port from the url .
