code: private void cleanIndexDirectory(String path) throws IOException
     {
        SecurityHelper.doPrivilegedIOExceptionAction((PrivilegedExceptionAction<Void>) () -> {
           File newIndexFolder = new File(path);
           if(newIndexFolder.exists())
           {
              DirectoryHelper.removeDirectory(newIndexFolder);
           }
           return null;
        });
     }
docs: remove index directory if exist
  @param path index directory path
  @throws IOException