comparison gnv-artifacts/src/main/java/de/intevation/gnv/utils/InputValidator.java @ 860:f94a95009423

Improved the input validator: empty strings are invalid (issue251). gnv-artifacts/trunk@989 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Mon, 26 Apr 2010 13:31:11 +0000
parents 05bf8534a35a
children 8f836fb6f592
comparison
equal deleted inserted replaced
859:3fbabd4803d7 860:f94a95009423
79 * @param input The input value. 79 * @param input The input value.
80 * @param type The input value type. 80 * @param type The input value type.
81 * @return true if the input is valid, otherwise false. 81 * @return true if the input is valid, otherwise false.
82 */ 82 */
83 public static boolean isInputValid(String input, String type) { 83 public static boolean isInputValid(String input, String type) {
84 if (input.length() == 0 || input.equals("")) {
85 return false;
86 }
87
84 log.debug("InputValidator.isInputValid " + input + " " + type); 88 log.debug("InputValidator.isInputValid " + input + " " + type);
85 89
86 // Let's check polygons and linestrings first, because they might 90 // Let's check polygons and linestrings first, because they might
87 // contain comma. A splitting at comma characters wouldn't be good here. 91 // contain comma. A splitting at comma characters wouldn't be good here.
88 if ("Polygon".equalsIgnoreCase(type) || "Linestring".equalsIgnoreCase(type)) 92 if ("Polygon".equalsIgnoreCase(type) || "Linestring".equalsIgnoreCase(type))

http://dive4elements.wald.intevation.org