int _main_port = -1;
char[] _main_host = null;
try {
parseUriReference(url, true);
if(_host == null) {
throw new URIException("no host");
}
_main_host = mainURI.getRawHost();
_main_port = mainURI.getPort();
_true_lor_url = Arrays.equals(_main_host, _host) && _main_port == _port
&& (Arrays.equals(_http_scheme, _scheme) || Arrays.equals(_https_scheme, _scheme));
/**
* Пытаемся вычислить, что fragment таки не encode
*/
if(_fragment != null) {
String fragmentStr = new String(_fragment);
String asciiFragment = fragmentStr.replaceAll("[^\\p{ASCII}]", "");
if(fragmentStr.length() != asciiFragment.length()) {
throw new URIException("error fragment?");
}
}
findURLIds();
} catch (URIException ex) {
parseUriReference(url, false);
if(_host == null) {
throw new URIException("no host");
}
_main_host = mainURI.getRawHost();
_main_port = mainURI.getPort();