@NotNull private static List<String> addVerifyNotNullOrEmpty(@NotNull List<String> exceptions, @Nullable final String input, @NotNull final String inputName) { if (StringUtilities.isEmpty(input)) { exceptions.add(String.format(EXCEPTION_NULL_EMPTY, inputName)); } return exceptions; }
public static int getPortValue(String port, int defaultValue){ if(StringUtilities.isEmpty(port)) { return defaultValue; } else { return StringUtils.validatePortNumber(port, Constants.PROXY_PORT); } } }
@NotNull private static List<String> addVerifyNumber(@NotNull List<String> exceptions, @Nullable final String input, @NotNull final String inputName) { if (StringUtilities.isEmpty(input)) { exceptions.add(String.format(EXCEPTION_NULL_EMPTY, inputName)); } else if (!NumberUtilities.isValidInt(input)) { exceptions.add(String.format(EXCEPTION_INVALID_PROXY, PROXY_PORT)); } return exceptions; } }
@NotNull private static List<String> addVerifyProxy(@NotNull List<String> exceptions, @Nullable final String input, @NotNull final String inputName) { if (StringUtilities.isEmpty(input)) { exceptions.add(String.format(EXCEPTION_NULL_EMPTY, inputName)); } else if (!isValidIpPort(input)) { exceptions.add(String.format(EXCEPTION_INVALID_PROXY, PROXY_PORT)); } return exceptions; }
public static int getPortValue(String port, int defaultValue){ if(StringUtilities.isEmpty(port)) { return defaultValue; } else { return StringUtils.validatePortNumber(port, Constants.PROXY_PORT); } } }
public static ProxyHTTP getHTTPProxy(String proxyHost, String proxyPort, String proxyUsername, String proxyPassword) { if (!StringUtilities.isEmpty(proxyHost)) { int portForProxy = getPortValue(proxyPort, Constants.DEFAULT_PROXY_PORT); return createHTTPProxy(proxyHost, portForProxy, proxyUsername, proxyPassword); } else { return null; } }
public static ProxyHTTP getHTTPProxy(String proxyHost, String proxyPort, String proxyUsername, String proxyPassword) { if (!StringUtilities.isEmpty(proxyHost)) { int portForProxy = getPortValue(proxyPort, Constants.DEFAULT_PROXY_PORT); return createHTTPProxy(proxyHost, portForProxy, proxyUsername, proxyPassword); } else { return null; } }
public static ProxyHTTP createHTTPProxy(String proxyHost, int proxyPort, String proxyUsername, String proxyPassword){ ProxyConnectionDetails proxyConnectionDetails = new ProxyConnectionDetails(proxyHost, proxyPort, proxyUsername, proxyPassword); ProxyHTTP proxyHTTP = new ProxyHTTP(proxyConnectionDetails.getProxyHost(), proxyConnectionDetails.getProxyPort()); String username = (StringUtilities.isEmpty(proxyUsername) ? null : proxyUsername); String password = (StringUtilities.isEmpty(proxyPassword) ? null : proxyPassword); proxyHTTP.setUserPasswd(username, password); return proxyHTTP; }
public static ProxyHTTP createHTTPProxy(String proxyHost, int proxyPort, String proxyUsername, String proxyPassword){ ProxyConnectionDetails proxyConnectionDetails = new ProxyConnectionDetails(proxyHost, proxyPort, proxyUsername, proxyPassword); ProxyHTTP proxyHTTP = new ProxyHTTP(proxyConnectionDetails.getProxyHost(), proxyConnectionDetails.getProxyPort()); String username = (StringUtilities.isEmpty(proxyUsername) ? null : proxyUsername); String password = (StringUtilities.isEmpty(proxyPassword) ? null : proxyPassword); proxyHTTP.setUserPasswd(username, password); return proxyHTTP; }
public static String populateUserBody(CreateUserInputs createUserInputs) { if (StringUtilities.isEmpty(createUserInputs.getOnPremisesImmutableId())) { CreateUserBody userBody = new CreateUserBody(); processUserBody(userBody, createUserInputs); return new Gson().toJson(userBody); } else { CreateUserBodyWithImmutableId userBody = new CreateUserBodyWithImmutableId(); userBody.setOnPremisesImmutableId(createUserInputs.getOnPremisesImmutableId()); processUserBody(userBody, createUserInputs); return new Gson().toJson(userBody); } }
if (StringUtilities.isEmpty(sshShellInputs.getCommand())) { throw new RuntimeException(COMMAND_IS_NOT_SPECIFIED_MESSAGE);
if (StringUtilities.isEmpty(sshShellInputs.getCommand())) { throw new RuntimeException(COMMAND_IS_NOT_SPECIFIED_MESSAGE);