public static String[] trimPercent(String[] array, int percent) { String[] d = new String[array.length]; for (int count = 0; count < array.length; count++) { d[count] = array[count]; } d = trimPercent(String.class, d, percent); return d; }
private static double[] roundTo(double[] values, int decimals) { double[] rounded = new double[values.length]; for (int count = 0; count < values.length; count++) { rounded[count] = roundTo(values[count], decimals); } return rounded; }
public String trimIntList(String str_list, String delimiter, int percent) throws Exception { int[] list = ListProcessor.toIntArray(str_list, delimiter); list = ListProcessor.trimPercent(ListProcessor.sort(list), percent); return ListProcessor.toString(list, delimiter); }
public String trimStringList(String str_list, String delimiter, int percent) throws Exception { String[] list = ListProcessor.toArray(str_list, delimiter); list = ListProcessor.trimPercent(ListProcessor.sort(list), percent); return ListProcessor.toString(list, delimiter); } }
public String trimDoubleList(String str_list, String delimiter, int percent) throws Exception { double[] list = ListProcessor.toDoubleArray(str_list, delimiter); list = ListProcessor.trimPercent(ListProcessor.sort(list), percent); return ListProcessor.toString(list, delimiter); }
public static int getPortValue(String port, int defaultValue){ if(StringUtilities.isEmpty(port)) { return defaultValue; } else { return StringUtils.validatePortNumber(port, Constants.PROXY_PORT); } } }
public static String[] toArray(String list, String delimiter) { return toArrayFromNormalized(normalizeString(list, delimiter), normalizeDelimiter(delimiter)); }
public static String getResponseFault(String response) throws ParserConfigurationException, SAXException, XPathExpressionException, IOException { return getResponseFaultReason(response) + getResponseFaultDetail(response); }
private static String getResponseFaultReason(String response) throws ParserConfigurationException, SAXException, XPathExpressionException, IOException { return XMLUtils.parseXml(response, FAULT_REASON_XPATH); }
/** * Validates a UUID value and throws a specific exception if UUID is invalid. * * @param uuid The UUID value to validate. * @param uuidValueOf The property associated to the given UUID value. * @throws RuntimeException */ public static void validateUUID(String uuid, String uuidValueOf) throws RuntimeException { if (!WSManUtils.isUUID(uuid)) { throw new RuntimeException("The returned " + uuidValueOf + " is not a valid UUID value! " + uuidValueOf + ": " + uuid); } }
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 String getResponseFault(String response) throws ParserConfigurationException, SAXException, XPathExpressionException, IOException { return getResponseFaultReason(response) + getResponseFaultDetail(response); }
private static String getResponseFaultDetail(String response) throws ParserConfigurationException, SAXException, XPathExpressionException, IOException { return XMLUtils.parseXml(response, FAULT_DETAIL_XPATH); }
public static int[] trimPercent(int[] array, int percent) { Integer[] d = new Integer[array.length]; for (int count = 0; count < array.length; count++) { d[count] = array[count]; } d = trimPercent(Integer.class, d, percent); array = new int[d.length]; for (int count = 0; count < array.length; count++) { array[count] = d[count]; } return array; }
/** * Validates a UUID value and throws a specific exception if UUID is invalid. * * @param uuid The UUID value to validate. * @param uuidValueOf The property associated to the given UUID value. * @throws RuntimeException */ public static void validateUUID(String uuid, String uuidValueOf) throws RuntimeException { if (!WSManUtils.isUUID(uuid)) { throw new RuntimeException("The returned " + uuidValueOf + " is not a valid UUID value! " + uuidValueOf + ": " + uuid); } }
public static String getScriptExitCode(String response) throws ParserConfigurationException, SAXException, XPathExpressionException, IOException { return XMLUtils.parseXml(response, SCRIPT_EXIT_CODE_XPATH); }
public static double[] trimPercent(double[] array, int percent) { Double[] d = new Double[array.length]; for (int count = 0; count < array.length; count++) { d[count] = array[count]; } d = trimPercent(Double.class, d, percent); array = new double[d.length]; for (int count = 0; count < array.length; count++) { array[count] = d[count]; } return array; }
private static String getResponseFaultDetail(String response) throws ParserConfigurationException, SAXException, XPathExpressionException, IOException { return XMLUtils.parseXml(response, FAULT_DETAIL_XPATH); }
private static String getResponseFaultReason(String response) throws ParserConfigurationException, SAXException, XPathExpressionException, IOException { return XMLUtils.parseXml(response, FAULT_REASON_XPATH); }
public static String getScriptExitCode(String response) throws ParserConfigurationException, SAXException, XPathExpressionException, IOException { return XMLUtils.parseXml(response, SCRIPT_EXIT_CODE_XPATH); }