@Test public void testReplaceIllegalChars() { assertEquals("eye _ ball", FileTools.replaceIllegalCharacters("eye ? ball", "_")); assertEquals("__", FileTools.replaceIllegalCharacters("*?", "_")); assertEquals("__", FileTools.replaceIllegalCharacters("<>", "_")); assertEquals("__", FileTools.replaceIllegalCharacters("][", "_")); assertEquals("__", FileTools.replaceIllegalCharacters("\\/", "_")); assertEquals("__", FileTools.replaceIllegalCharacters(":;", "_")); assertEquals("__", FileTools.replaceIllegalCharacters("\",", "_")); assertEquals("__", FileTools.replaceIllegalCharacters("+=", "_")); assertEquals("__", FileTools.replaceIllegalCharacters("|,", "_")); assertEquals("abcdefg.txt", FileTools.replaceIllegalCharacters("abcdefg.txt", "_")); }
public static String replaceIllegalCharacters(String name, String replacement) { return name.replaceAll("[\\?\\[\\]/\\\\=\\+\\<\\>\\:\\;\"\\,\\*\\|]", replacement); }
FileTools { public static String replaceIllegalCharacters(String name, String replacement) { return name.replaceAll("[\\?\\[\\]/\\\\=\\+\\<\\>\\:\\;\"\\,\\*\\|]", replacement); } }
FileTools { public static String replaceIllegalCharacters(String name, String replacement) { return name.replaceAll("[\\?\\[\\]/\\\\=\\+\\<\\>\\:\\;\"\\,\\*\\|]", replacement); }  }
FileTools { public static String replaceIllegalCharacters(String name, String replacement) { return name.replaceAll("[\\?\\[\\]/\\\\=\\+\\<\\>\\:\\;\"\\,\\*\\|]", replacement); }  static String replaceIllegalCharacters(String name, String replacement); static URL asUrl(String url); static String getExtension(String name); static String getParent(File file); }
FileTools { public static String replaceIllegalCharacters(String name, String replacement) { return name.replaceAll("[\\?\\[\\]/\\\\=\\+\\<\\>\\:\\;\"\\,\\*\\|]", replacement); }  static String replaceIllegalCharacters(String name, String replacement); static URL asUrl(String url); static String getExtension(String name); static String getParent(File file);  }