public void reconstructChains(QuadTree<DigicoreFacility> facilityTree,ObjectAttributes facilityAttributes,String inputFolder,String outputFolder,int nThreads,Geometry studyArea) throws IOException {
  long startTime=System.currentTimeMillis();
  File folder=new File(outputFolder);
  if (folder.exists()) {
    log.warn("The output folder exists and will be deleted.");
    log.warn("  --> " + folder.getAbsolutePath());
    FileUtils.delete(folder);
  }
  boolean created=folder.mkdirs();
  if (!created) {
    log.error("Could not create the output folder " + folder.getAbsolutePath());
  }
  List<File> vehicleList=FileUtils.sampleFiles(new File(inputFolder),Integer.MAX_VALUE,FileUtils.getFileFilter(".xml.gz"));
  ExecutorService threadExecutor=Executors.newFixedThreadPool(nThreads);
  Counter threadCounter=new Counter("   vehicles completed: ");
  for (  File vehicleFile : vehicleList) {
    RunnableChainReconstructor rcr=new RunnableChainReconstructor(vehicleFile,facilityTree,facilityAttributes,threadCounter,outputFolder,studyArea);
    threadExecutor.execute(rcr);
  }
  threadExecutor.shutdown();
  while (!threadExecutor.isTerminated()) {
  }
  threadCounter.printCounter();
  log.info("  chains reconstructed.");
  reconstructDuration=System.currentTimeMillis() - startTime;
}

public void reconstructChains ( QuadTree < DigicoreFacility > facilityTree , ObjectAttributes facilityAttributes , String inputFolder , String outputFolder , int nThreads , Geometry studyArea ) throws IOException { long startTime = System . currentTimeMillis ( ) ; File folder = new File ( outputFolder ) ; if ( folder . exists ( ) ) { log . warn ( "The output folder exists and will be deleted." ) ; log . warn ( "  --> " + folder . getAbsolutePath ( ) ) ; FileUtils . delete ( folder ) ; } boolean created = folder . mkdirs ( ) ; if ( ! created ) { log . error ( "Could not create the output folder " + folder . getAbsolutePath ( ) ) ; } List < File > vehicleList = FileUtils . sampleFiles ( new File ( inputFolder ) , Integer . MAX_VALUE , FileUtils . getFileFilter ( ".xml.gz" ) ) ; ExecutorService threadExecutor = Executors . newFixedThreadPool ( nThreads ) ; Counter threadCounter = new Counter ( "   vehicles completed: " ) ; for ( File vehicleFile : vehicleList ) { RunnableChainReconstructor rcr = new RunnableChainReconstructor ( vehicleFile , facilityTree , facilityAttributes , threadCounter , outputFolder , studyArea ) ; threadExecutor . execute ( rcr ) ; } threadExecutor . shutdown ( ) ; while ( ! threadExecutor . isTerminated ( ) ) { } threadCounter . printCounter ( ) ; log . info ( "  chains reconstructed." ) ; reconstructDuration = System . currentTimeMillis ( ) - startTime ; }
this method takes each vehicle file and reconstructs the chains .
