ValidationUtil { public static boolean path(String path) { try { new File(path).getCanonicalPath(); return true; } catch (Throwable e) { return false; } } private  ValidationUtil(); static boolean username(String user); static boolean group(String group); static boolean password(String password); static boolean privateIP(String ip); static boolean address(String address); static boolean port(String port); static boolean port(int port); static boolean path(String path); static boolean version(String version); static boolean email(String email); static boolean ipv4(String ipv4); static final int USER_MAX; static final int USER_MIN; static final int GROUP_MAX; static final int GROUP_MIN; static final int PASSWORD_MAX; static final int PASSWORD_MIN; }
@Test void testPath() { assertFalse(path(null)); assertTrue(path("test/.test.txt")); }