public void analyse(int analysis,String xmlFolder,String input,String output){
  File folder=new File(xmlFolder);
  if (!folder.exists() || !folder.canRead() || !folder.isDirectory()) {
    throw new IllegalArgumentException("Cannot read from " + xmlFolder);
  }
  List<File> vehicleFiles=null;
  if (input == null) {
    vehicleFiles=FileUtils.sampleFiles(folder,Integer.MAX_VALUE,FileUtils.getFileFilter(".xml.gz"));
  }
 else {
    File f=new File(input);
    if (input.equalsIgnoreCase("null") || !f.exists() || !f.isFile()|| !f.canRead()) {
      vehicleFiles=FileUtils.sampleFiles(folder,Integer.MAX_VALUE,FileUtils.getFileFilter(".xml.gz"));
    }
 else {
      try {
        vehicleFiles=DigicoreUtils.readDigicoreVehicleIds(input,xmlFolder);
      }
 catch (      IOException e) {
        e.printStackTrace();
        throw new RuntimeException("Could not read vehicle Ids from " + input);
      }
    }
  }
switch (analysis) {
case 1:
    runMinorActivityStartTimeAnalysis(vehicleFiles,output);
  break;
case 2:
runActivitiesWithFacilityIdAnalysis(vehicleFiles,output);
break;
case 3:
runMinorActivityDurationAnalysis(vehicleFiles,output);
break;
default :
LOG.error("Cannot resolve '" + analysis + " to a valid analysis.");
throw new IllegalArgumentException("Invalid analysis parameter.");
}
}

public void analyse ( int analysis , String xmlFolder , String input , String output ) { File folder = new File ( xmlFolder ) ; if ( ! folder . exists ( ) || ! folder . canRead ( ) || ! folder . isDirectory ( ) ) { throw new IllegalArgumentException ( "Cannot read from " + xmlFolder ) ; } List < File > vehicleFiles = null ; if ( input == null ) { vehicleFiles = FileUtils . sampleFiles ( folder , Integer . MAX_VALUE , FileUtils . getFileFilter ( ".xml.gz" ) ) ; } else { File f = new File ( input ) ; if ( input . equalsIgnoreCase ( "null" ) || ! f . exists ( ) || ! f . isFile ( ) || ! f . canRead ( ) ) { vehicleFiles = FileUtils . sampleFiles ( folder , Integer . MAX_VALUE , FileUtils . getFileFilter ( ".xml.gz" ) ) ; } else { try { vehicleFiles = DigicoreUtils . readDigicoreVehicleIds ( input , xmlFolder ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; throw new RuntimeException ( "Could not read vehicle Ids from " + input ) ; } } } switch ( analysis ) { case 1 : runMinorActivityStartTimeAnalysis ( vehicleFiles , output ) ; break ; case 2 : runActivitiesWithFacilityIdAnalysis ( vehicleFiles , output ) ; break ; case 3 : runMinorActivityDurationAnalysis ( vehicleFiles , output ) ; break ; default : LOG . error ( "Cannot resolve '" + analysis + " to a valid analysis." ) ; throw new IllegalArgumentException ( "Invalid analysis parameter." ) ; } }
perform a variety of analysis on digicore vehicle files .
