SchemaCache { static void delete(File file) { if (file.isDirectory()) { for (File f : file.listFiles()) { delete(f); } } file.delete(); } SchemaCache(File directory, boolean download);  SchemaCache(File directory, boolean download, boolean keepQuery); File getDirectory(); File getTempDirectory(); boolean isDownloadAllowed(); String resolveLocation(String location); static SchemaCache buildAutomaticallyConfiguredUsingFileUrl(URL url); static void disableAutomaticConfiguration(); static void enableAutomaticConfiguration(); static boolean isAutomaticConfigurationEnabled();  }
@Test public void delete() throws Exception { (new File("target/test/a/b/c")).mkdirs(); (new File("target/test/a/b/d/e/f")).mkdirs(); File f = new File("target/test/a/b/d/e/f/temp.txt"); PrintWriter printWriter = null; try { printWriter = new PrintWriter(f); printWriter.println("Some text"); } finally { if (printWriter != null) { printWriter.close(); } } Assert.assertTrue((new File("target/test/a/b/d/e/f/temp.txt")).exists()); SchemaCache.delete(new File("target/test/a")); Assert.assertFalse((new File("target/test/a")).exists()); }