| | |
| | | return false; |
| | | } |
| | | |
| | | public static boolean stringToBoolean(String value) { |
| | | public static boolean StringToBoolean(String value) { |
| | | if (value != null) { |
| | | value = value.toLowerCase(); |
| | | |
| | |
| | | return false; |
| | | } |
| | | |
| | | public static int stringToInt(String value, int defaultValue) { |
| | | public static int StringToInt(String value, int defaultValue) { |
| | | if (value != null) { |
| | | try { |
| | | Double doubleValue = Double.valueOf(value); |
| | |
| | | return defaultValue; |
| | | } |
| | | |
| | | public static BigDecimal stringToBigDecimal(String value, BigDecimal defaultValue) { |
| | | public static BigDecimal StringToBigDecimal(String value, BigDecimal defaultValue) { |
| | | if (value == null) { |
| | | return defaultValue; |
| | | } |
| | |
| | | return calendar.get(Calendar.MONTH) + 1; |
| | | } |
| | | |
| | | public static String joinPath(String parent, String path) { |
| | | if (isEmptyStr(parent)) { |
| | | return path; |
| | | } |
| | | |
| | | parent = parent.replace("\\", "/"); |
| | | path = path.replace("\\", "/"); |
| | | |
| | | if ('/' == parent.charAt(parent.length() - 1)) { |
| | | parent = parent.substring(0, parent.length() - 1); |
| | | } |
| | | |
| | | if ('/' == path.charAt(0)) { |
| | | path = path.substring(1); |
| | | } |
| | | |
| | | return parent + "/" + path; |
| | | } |
| | | |
| | | } |