}
URI uri;
try
{
uri = new URI( targetPath );
uri.toURL(); // check protocol
}
catch ( Exception e )
{
uri = null;
}
// fall-back to file-system approach
if ( null == uri || !uri.isAbsolute() )
{
uri = new File( targetPath ).toURI();
}
return uri;
42: String h = uri.getHost();
43: int port = uri.getPort();
44: String password = uri.getUserInfo().split(":", 2)[1];
45: int database = Integer.parseInt(uri.getPath().split("/", 2)[1]);
Full Snippet Info