private void parseProxy(String text) throws BadCommandLineException { int i = text.lastIndexOf('@'); int j = text.lastIndexOf(':'); if (i > 0) { proxyAuth = text.substring(0, i); if (j > i) { proxyHost = text.substring(i + 1, j); proxyPort = text.substring(j + 1); } else { proxyHost = text.substring(i + 1); proxyPort = "8080"; } } else { //no auth info if (j < 0) { //no port proxyHost = text; proxyPort = "8080"; } else { proxyHost = text.substring(0, j); proxyPort = text.substring(j + 1); } } try { Integer.valueOf(proxyPort); } catch (NumberFormatException e) { throw new BadCommandLineException(WscompileMessages.WSIMPORT_ILLEGAL_PROXY(text)); } }
private void parseProxy(String text) throws BadCommandLineException { int i = text.lastIndexOf('@'); int j = text.lastIndexOf(':'); if (i > 0) { proxyAuth = text.substring(0, i); if (j > i) { proxyHost = text.substring(i + 1, j); proxyPort = text.substring(j + 1); } else { proxyHost = text.substring(i + 1); proxyPort = "8080"; } } else { //no auth info if (j < 0) { //no port proxyHost = text; proxyPort = "8080"; } else { proxyHost = text.substring(0, j); proxyPort = text.substring(j + 1); } } try { Integer.valueOf(proxyPort); } catch (NumberFormatException e) { throw new BadCommandLineException(WscompileMessages.WSIMPORT_ILLEGAL_PROXY(text)); } }
private void parseProxy(String text) throws BadCommandLineException { int i = text.lastIndexOf('@'); int j = text.lastIndexOf(':'); if (i > 0) { proxyAuth = text.substring(0, i); if (j > i) { proxyHost = text.substring(i + 1, j); proxyPort = text.substring(j + 1); } else { proxyHost = text.substring(i + 1); proxyPort = "8080"; } } else { //no auth info if (j < 0) { //no port proxyHost = text; proxyPort = "8080"; } else { proxyHost = text.substring(0, j); proxyPort = text.substring(j + 1); } } try { Integer.valueOf(proxyPort); } catch (NumberFormatException e) { throw new BadCommandLineException(WscompileMessages.WSIMPORT_ILLEGAL_PROXY(text)); } }
private void parseProxy(String text) throws BadCommandLineException { int i = text.lastIndexOf('@'); int j = text.lastIndexOf(':'); if (i > 0) { proxyAuth = text.substring(0, i); if (j > i) { proxyHost = text.substring(i + 1, j); proxyPort = text.substring(j + 1); } else { proxyHost = text.substring(i + 1); proxyPort = "8080"; } } else { //no auth info if (j < 0) { //no port proxyHost = text; proxyPort = "8080"; } else { proxyHost = text.substring(0, j); proxyPort = text.substring(j + 1); } } try { Integer.valueOf(proxyPort); } catch (NumberFormatException e) { throw new BadCommandLineException(WscompileMessages.WSIMPORT_ILLEGAL_PROXY(text)); } }