public static boolean delete(File path)
    {
        if (!path.exists()) {
            return false;
        }
        boolean ret = true;
        if (path.isDirectory()) {
            File[] files = path.listFiles();
            if (files != null) {
                for (File f : files) {
                    ret = ret && delete(f);
                }
            }
        }
        return ret && path.delete();
    }
@Test
    public void testDeleteFile() throws IOException
    {
        File dir = new File(TemporaryFolderFinder.resolve("testfile"));
        dir.mkdirs();
        File path = File.createTempFile("test", "suffix", dir);

        assertThat(path.exists(), is(true));
        Utils.delete(dir);
        assertThat(path.exists(), is(false));
    }