public static MatchInfo fromUri ( final URI uri , final HttpMethod method ) { int newPort = uri . getPort ( ) ; if ( newPort < 0 ) { try { newPort = uri . toURL ( ) . getDefaultPort ( ) ; } catch ( MalformedURLException | IllegalArgumentException e ) { newPort = ANY_PORT ; } } return new MatchInfo ( uri . getScheme ( ) , uri . getHost ( ) , newPort , uri . getPath ( ) , uri . getQuery ( ) , uri . getFragment ( ) , ANY_REALM , method ) ; }
Create an info object from a uri and the http method object .