public static URI toURI ( String uri ) throws URISyntaxException { final URI u = new URI ( uri ) ; // Inspired by ZeroMQ String adr = u . getAuthority ( ) ; if ( adr == null ) { adr = u . getPath ( ) ; } if ( adr != null && adr . endsWith ( ":*" ) ) { //$NON-NLS-1$ return new URI ( u . getScheme ( ) , u . getUserInfo ( ) , adr . substring ( 0 , adr . length ( ) - 2 ) , - 1 , null , u . getQuery ( ) , u . getFragment ( ) ) ; } return u ; }
Convert a string URI to an object URI .