FileUtils implements Serializable { public static String makeFilename(String value) { if (value == null) { return ""; } return value.replaceAll("\\s", "_").replaceAll("[^\\w-\\.]", ""); } private  FileUtils(); static File getResourceFile(String name); static byte[] inputStreamToBytes(InputStream in); static byte[] getBytesFromFile(File file); static String replaceExtension(String filename, String newExtension); static String makeFilename(String value); static void writeToFile(InputStream in, OutputStream out); static final String FILENAME_SEPARATOR; }
@Test public void testConvertUri() { String filename = FileUtils .makeFilename("http: assertTrue(filename.indexOf('/') == -1); }