code: public static void delete(File f) {
          if (!f.exists()) {
              return;
          }
          File[] subFiles = f.listFiles();
          if (subFiles != null) {
              for (File sf : subFiles) {
                  delete(sf);
              }
          }
          if (!f.delete()) {
              throw new HazelcastException("Failed to delete " + f);
          }
      }
docs: Ensures that the file described by the supplied parameter does not exist
  after the method returns. If the file didn't exist, returns silently.
  If the file could not be deleted, fails with an exception.
  If the file is a directory, its children are recursively deleted.