@Test void testValidateFilePath() { assertFilePathValidationSuccess("/foo.txt"); assertFilePathValidationSuccess("/foo/bar.txt"); assertFilePathValidationSuccess("/foo.bar/baz.json"); assertFilePathValidationSuccess("/foo-bar/baz-json"); assertFilePathValidationFailure("foo"); assertFilePathValidationFailure("/"); assertFilePathValidationFailure("/foo/"); assertFilePathValidationFailure(" assertFilePathValidationFailure("/foo assertFilePathValidationFailure("/."); assertFilePathValidationFailure("/.."); assertFilePathValidationFailure("/.foo"); assertFilePathValidationFailure("/foo."); assertFilePathValidationFailure("/.foo."); assertFilePathValidationFailure("/\t"); assertFilePathValidationFailure("/80:20"); assertFilePathValidationFailure("/foo*.txt"); assertFilePathValidationFailure("/bar?.txt"); assertFilePathValidationFailure("/baz|.txt"); assertFilePathValidationFailure("/\uAC00\uB098\uB2E4.json"); }
public static String validateFilePath(String path, String paramName) { requireNonNull(path, paramName); checkArgument(isValidFilePath(path), "%s: %s (expected: %s)", paramName, path, FILE_PATH_PATTERN); return path; }
Util { public static String validateFilePath(String path, String paramName) { requireNonNull(path, paramName); checkArgument(isValidFilePath(path), "%s: %s (expected: %s)", paramName, path, FILE_PATH_PATTERN); return path; } }
Util { public static String validateFilePath(String path, String paramName) { requireNonNull(path, paramName); checkArgument(isValidFilePath(path), "%s: %s (expected: %s)", paramName, path, FILE_PATH_PATTERN); return path; } private  Util(); }
Util { public static String validateFilePath(String path, String paramName) { requireNonNull(path, paramName); checkArgument(isValidFilePath(path), "%s: %s (expected: %s)", paramName, path, FILE_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 validateFilePath(String path, String paramName) { requireNonNull(path, paramName); checkArgument(isValidFilePath(path), "%s: %s (expected: %s)", paramName, path, FILE_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);  }