private void downloadIndexFiles(boolean downloadCompleteIndex,Directory indexDir,Directory tmpIndexDir,long latestGeneration) throws Exception {
  if (LOG.isDebugEnabled()) {
    LOG.debug("Download files to dir: " + Arrays.asList(indexDir.listAll()));
  }
  for (  Map<String,Object> file : filesToDownload) {
    if (!slowFileExists(indexDir,(String)file.get(NAME)) || downloadCompleteIndex) {
      dirFileFetcher=new DirectoryFileFetcher(tmpIndexDir,file,(String)file.get(NAME),false,latestGeneration);
      currentFile=file;
      dirFileFetcher.fetchFile();
      filesDownloaded.add(new HashMap<>(file));
    }
 else {
      LOG.info("Skipping download for " + file.get(NAME) + " because it already exists");
    }
  }
}

private void downloadIndexFiles ( boolean downloadCompleteIndex , Directory indexDir , Directory tmpIndexDir , long latestGeneration ) throws Exception { if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "Download files to dir: " + Arrays . asList ( indexDir . listAll ( ) ) ) ; } for ( Map < String , Object > file : filesToDownload ) { if ( ! slowFileExists ( indexDir , ( String ) file . get ( NAME ) ) || downloadCompleteIndex ) { dirFileFetcher = new DirectoryFileFetcher ( tmpIndexDir , file , ( String ) file . get ( NAME ) , false , latestGeneration ) ; currentFile = file ; dirFileFetcher . fetchFile ( ) ; filesDownloaded . add ( new HashMap < > ( file ) ) ; } else { LOG . info ( "Skipping download for " + file . get ( NAME ) + " because it already exists" ) ; } } }
download the index files . if a new index is needed , download all the files .
