presto-raptor-legacy/src/main/java/io/prestosql/plugin/raptor/legacy/storage/FileStorageService.java/FileStorageService/deleteDirectory
class FileStorageService:    private static void deleteDirectory(File dir)
            throws IOException
    {
        if (!dir.exists()) {
            return;
        }
        File[] files = dir.listFiles();
        if (files == null) {
            throw new IOException("Failed to list directory: " + dir);
        }
        for (File file : files) {
            Files.deleteIfExists(file.toPath());
        }
        Files.deleteIfExists(dir.toPath());
    }