/** * Constructor not part of API. * @param e Underlying cause. */ public MalformedIDNException(Exception e) { super("Bad Internationalized Domain Name: "+e.getMessage()); initCause(e); }
private static CharSequence domainToAscii(String host) throws MalformedIDNException { try { return IDNP.toASCII(host, IDN.USE_STD3_ASCII_RULES|IDN.ALLOW_UNASSIGNED); // IDNP (patched IDN) throws IlleaglArgimentException } catch (IllegalArgumentException ex) { // IDNP (patched IDN) throws IlleaglArgumentException throw new MalformedIDNException(ex) ; } /* int u[] = new int[host.length()]; for (int i = 0; i < host.length(); i++) u[i] = host.charAt(i); try { return idna.domainToAscii(u); } catch (XcodeException e) { throw new MalformedIDNException(e); } */ }
@Override public URI toURI() throws URISyntaxException { try { String x = createASCIIString() ; return new URI(x) ; } catch (MalformedIDNException ex) { throw new URISyntaxException(toDisplayString(), ex.getMessage()) ; } }
static CharSequence domainToAscii(String host) throws MalformedIDNException { try { return IDNP.toASCII(host, IDN.USE_STD3_ASCII_RULES|IDN.ALLOW_UNASSIGNED); } catch (Exception e) { throw new MalformedIDNException(e); } /* int u[] = new int[host.length()]; for (int i = 0; i < host.length(); i++) u[i] = host.charAt(i); try { return idna.domainToAscii(u); } catch (XcodeException e) { throw new MalformedIDNException(e); } */ }
@Override public URI toURI() throws URISyntaxException { try { String x = createASCIIString() ; return new URI(x) ; } catch (MalformedIDNException ex) { throw new URISyntaxException(toDisplayString(), ex.getMessage()) ; } }
/** * Constructor not part of API. * @param e Underlying cause. */ public MalformedIDNException(Exception e) { super("Bad Internationalized Domain Name: "+e.getMessage()); initCause(e); }
private static CharSequence domainToAscii(String host) throws MalformedIDNException { try { return IDNP.toASCII(host, IDN.USE_STD3_ASCII_RULES|IDN.ALLOW_UNASSIGNED); // IDNP (patched IDN) throws IlleaglArgimentException } catch (IllegalArgumentException ex) { // IDNP (patched IDN) throws IlleaglArgumentException throw new MalformedIDNException(ex) ; } /* int u[] = new int[host.length()]; for (int i = 0; i < host.length(); i++) u[i] = host.charAt(i); try { return idna.domainToAscii(u); } catch (XcodeException e) { throw new MalformedIDNException(e); } */ }
/** * Constructor not part of API. * @param e Underlying cause. */ public MalformedIDNException(Exception e) { super("Bad Internationalized Domain Name: "+e.getMessage()); initCause(e); }