try {
// Create a HarvestSource of the object we want to harvest.
FileHarvestSource source = new FileHarvestSource(file);
// Get the native Configuration.
Configuration c = Config.getInstance().getConfiguration("Extract in Native form");
// Harvest the file. Note that the output is sent to a file as
// specified in the configuration. This class produces very little
// in the way of direct output.
c.getHarvester().harvest(c, source, new PropsManager());
// Get the NLNZ Data Dictionary configuration.
c = Config.getInstance().getConfiguration("NLNZ Data Dictionary");
// Harvest the file. Note that the output is sent to a file as
// specified in the configuration. This class produces very little
// in the way of direct output.
c.getHarvester().harvest(c, source, new PropsManager());
System.out.println("Harvest Completed Successfully");
}
catch(ConfigurationException ex) {
// Exception initialising the harvester.