com.googlecode.fascinator.harvester.csv
Class CSVHarvester

java.lang.Object
  extended by com.googlecode.fascinator.common.harvester.impl.GenericHarvester
      extended by com.googlecode.fascinator.harvester.csv.CSVHarvester
All Implemented Interfaces:
com.googlecode.fascinator.api.harvester.Harvester, com.googlecode.fascinator.api.Plugin

public class CSVHarvester
extends com.googlecode.fascinator.common.harvester.impl.GenericHarvester

Harvester for CSV files.

Configuration options:

You can select to harvest all columns (fields) or be selective:

Fields with repeated names result in only the first value being stored.

Based on Greg Pendlebury's CallistaHarvester.

Author:
Duncan Dickinson

Constructor Summary
CSVHarvester()
          Constructs the CSV harvester plugin.
 
Method Summary
 Set<String> getObjectIdList()
          Harvest the next batch of rows and return their object IDs.
 boolean hasMoreObjects()
          Check if there are more objects to harvest.
 void init()
          Initialise the CSV harvester plugin.
 void shutdown()
          Shutdown the plugin.
 
Methods inherited from class com.googlecode.fascinator.common.harvester.impl.GenericHarvester
getDeletedObjectIdList, getId, getJsonConfig, getName, getObjectId, getPluginDetails, getStorage, hasMoreDeletedObjects, init, init, setStorage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CSVHarvester

public CSVHarvester()
Constructs the CSV harvester plugin.

Method Detail

init

public void init()
          throws com.googlecode.fascinator.api.harvester.HarvesterException
Initialise the CSV harvester plugin.

Specified by:
init in class com.googlecode.fascinator.common.harvester.impl.GenericHarvester
Throws:
com.googlecode.fascinator.api.harvester.HarvesterException - if an error occurred

shutdown

public void shutdown()
              throws com.googlecode.fascinator.api.harvester.HarvesterException
Shutdown the plugin.

Specified by:
shutdown in interface com.googlecode.fascinator.api.Plugin
Overrides:
shutdown in class com.googlecode.fascinator.common.harvester.impl.GenericHarvester
Throws:
com.googlecode.fascinator.api.harvester.HarvesterException - if an error occurred

hasMoreObjects

public boolean hasMoreObjects()
Check if there are more objects to harvest.

Returns:
true if there are more, false otherwise

getObjectIdList

public Set<String> getObjectIdList()
                            throws com.googlecode.fascinator.api.harvester.HarvesterException
Harvest the next batch of rows and return their object IDs.

Returns:
the set of object IDs just harvested
Throws:
com.googlecode.fascinator.api.harvester.HarvesterException - if an error occurred


Copyright © 2009-2011. All Rights Reserved.