IoUtil { public static String sanitizeFileName(String name) { if (name != null) { return name.replaceAll("[^A-Za-z0-9]+", "-"); } return null; }  static void download(Logger log, URL downloadUrl, File target); static int getFreeRandomPort(); static int getFreeRandomPort(int min, int max, int attempts); static String sanitizeFileName(String name);  }
@Test public void testSanitizeFileName() { assertEquals(null, IoUtil.sanitizeFileName(null)); assertEquals("Hello-World", IoUtil.sanitizeFileName("Hello/&%World")); assertEquals("-H-e-l-l-o-", IoUtil.sanitizeFileName(" _H-.-e-.-l-l--. assertEquals("s2i-env-docker-io-fabric8-java-latest", IoUtil.sanitizeFileName("s2i-env-docker.io/fabric8/java:latest")); }