@Test public void shouldCreateDirectory() throws IOException { File file = File.createTempFile("glowroot-unit-test-", ""); file.delete(); ClassLoaders.createDirectoryOrCleanPreviousContentsWithPrefix(file, "abc"); assertThat(file.isDirectory()).isTrue(); }
static void createDirectoryOrCleanPreviousContentsWithPrefix(File dir, String prefix) throws IOException { deleteIfRegularFile(dir); if (dir.exists()) { deleteFilesWithPrefix(dir, prefix); } else { createDirectory(dir); } }
ClassLoaders { static void createDirectoryOrCleanPreviousContentsWithPrefix(File dir, String prefix) throws IOException { deleteIfRegularFile(dir); if (dir.exists()) { deleteFilesWithPrefix(dir, prefix); } else { createDirectory(dir); } } }
ClassLoaders { static void createDirectoryOrCleanPreviousContentsWithPrefix(File dir, String prefix) throws IOException { deleteIfRegularFile(dir); if (dir.exists()) { deleteFilesWithPrefix(dir, prefix); } else { createDirectory(dir); } } private  ClassLoaders(); }
ClassLoaders { static void createDirectoryOrCleanPreviousContentsWithPrefix(File dir, String prefix) throws IOException { deleteIfRegularFile(dir); if (dir.exists()) { deleteFilesWithPrefix(dir, prefix); } else { createDirectory(dir); } } private  ClassLoaders();  }
ClassLoaders { static void createDirectoryOrCleanPreviousContentsWithPrefix(File dir, String prefix) throws IOException { deleteIfRegularFile(dir); if (dir.exists()) { deleteFilesWithPrefix(dir, prefix); } else { createDirectory(dir); } } private  ClassLoaders();   }