public static boolean isWindowsAbsolutePath(@NotNull String pathString) { if (pathString.length() >= 2 && Character.isLetter(pathString.charAt(0)) && pathString.charAt(1) == ':') { return true; } return false; }
/** * Has duplicate: {@link * com.intellij.coverage.listeners.CoverageListener#sanitize(java.lang.String, java.lang.String)} * as FileUtil is not available in client's vm */ @NotNull public static String sanitizeFileName(@NotNull String name) { StringBuilder result = new StringBuilder(); for (int i = 0; i < name.length(); i++) { final char ch = name.charAt(i); if (ch > 0 && ch < 255) { if (Character.isLetterOrDigit(ch)) { result.append(ch); } else { result.append("_"); } } } return result.toString(); }