@Test void testValidateDirPath() { assertDirPathValidationSuccess("/"); assertDirPathValidationSuccess("/foo"); assertDirPathValidationSuccess("/foo/"); assertDirPathValidationSuccess("/foo/bar"); assertDirPathValidationSuccess("/foo/bar/"); assertDirPathValidationSuccess("/foo.bar/"); assertDirPathValidationSuccess("/foo-bar/"); assertDirPathValidationFailure("foo"); assertDirPathValidationFailure(" assertDirPathValidationFailure("/foo assertDirPathValidationFailure("/./"); assertDirPathValidationFailure("/../"); assertDirPathValidationFailure("/.foo/"); assertDirPathValidationFailure("/foo./"); assertDirPathValidationFailure("/.foo./"); assertDirPathValidationFailure("/\t/"); assertDirPathValidationFailure("/80:20/"); assertDirPathValidationFailure("/foo*/"); assertDirPathValidationFailure("/bar?/"); assertDirPathValidationFailure("/baz|/"); assertDirPathValidationFailure("/\uAC00\uB098\uB2E4/"); }
public static String validateDirPath(String path, String paramName) { requireNonNull(path, paramName); checkArgument(isValidDirPath(path), "%s: %s (expected: %s)", paramName, path, DIR_PATH_PATTERN); return path; }
Util { public static String validateDirPath(String path, String paramName) { requireNonNull(path, paramName); checkArgument(isValidDirPath(path), "%s: %s (expected: %s)", paramName, path, DIR_PATH_PATTERN); return path; } }
Util { public static String validateDirPath(String path, String paramName) { requireNonNull(path, paramName); checkArgument(isValidDirPath(path), "%s: %s (expected: %s)", paramName, path, DIR_PATH_PATTERN); return path; } private  Util(); }
Util { public static String validateDirPath(String path, String paramName) { requireNonNull(path, paramName); checkArgument(isValidDirPath(path), "%s: %s (expected: %s)", paramName, path, DIR_PATH_PATTERN); return path; } private  Util(); static String validateFileName(String name, String paramName); static boolean isValidFileName(String name); static String validateFilePath(String path, String paramName); static boolean isValidFilePath(String path); static String validateJsonFilePath(String path, String paramName); static boolean isValidJsonFilePath(String path); static String validateJsonPath(String jsonPath, String paramName); static boolean isValidJsonPath(String jsonPath); static String validateDirPath(String path, String paramName); static boolean isValidDirPath(String path); static boolean isValidDirPath(String path, boolean mustEndWithSlash); static String validatePathPattern(String pathPattern, String paramName); static boolean isValidPathPattern(String pathPattern); static String validateProjectName(String projectName, String paramName); static boolean isValidProjectName(String projectName); static String validateRepositoryName(String repoName, String paramName); static boolean isValidRepositoryName(String repoName); static String validateEmailAddress(String emailAddr, String paramName); static boolean isValidEmailAddress(String emailAddr); static String toEmailAddress(String emailAddr, String paramName); static String emailToUsername(String emailAddr, String paramName); static List<String> stringToLines(String str); static String simpleTypeName(Object obj); static String simpleTypeName(Class<?> clazz); static String simpleTypeName(Class<?> clazz, boolean decapitalize); @SuppressWarnings("unchecked") static T unsafeCast(Object o); static Iterable<T> requireNonNullElements(Iterable<T> values, String name); static void deleteFileTree(File directory); }
Util { public static String validateDirPath(String path, String paramName) { requireNonNull(path, paramName); checkArgument(isValidDirPath(path), "%s: %s (expected: %s)", paramName, path, DIR_PATH_PATTERN); return path; } private  Util(); static String validateFileName(String name, String paramName); static boolean isValidFileName(String name); static String validateFilePath(String path, String paramName); static boolean isValidFilePath(String path); static String validateJsonFilePath(String path, String paramName); static boolean isValidJsonFilePath(String path); static String validateJsonPath(String jsonPath, String paramName); static boolean isValidJsonPath(String jsonPath); static String validateDirPath(String path, String paramName); static boolean isValidDirPath(String path); static boolean isValidDirPath(String path, boolean mustEndWithSlash); static String validatePathPattern(String pathPattern, String paramName); static boolean isValidPathPattern(String pathPattern); static String validateProjectName(String projectName, String paramName); static boolean isValidProjectName(String projectName); static String validateRepositoryName(String repoName, String paramName); static boolean isValidRepositoryName(String repoName); static String validateEmailAddress(String emailAddr, String paramName); static boolean isValidEmailAddress(String emailAddr); static String toEmailAddress(String emailAddr, String paramName); static String emailToUsername(String emailAddr, String paramName); static List<String> stringToLines(String str); static String simpleTypeName(Object obj); static String simpleTypeName(Class<?> clazz); static String simpleTypeName(Class<?> clazz, boolean decapitalize); @SuppressWarnings("unchecked") static T unsafeCast(Object o); static Iterable<T> requireNonNullElements(Iterable<T> values, String name); static void deleteFileTree(File directory);  }