pulse - the web application framework Get pulse at SourceForge.net. Fast, secure and Free Open Source software downloads Ohloh project report for pulse-java

org.torweg.pulse.component.util.retailer.imports
Class CSVRetailerImporter

java.lang.Object
  extended by org.torweg.pulse.component.util.retailer.imports.AbstractRetailerImporter
      extended by org.torweg.pulse.component.util.retailer.imports.CSVRetailerImporter

public class CSVRetailerImporter
extends AbstractRetailerImporter

A AbstractRetailerImporter that imports Retailers from a csv File.

Version:
$Revision: 1581 $
Author:
Christian Schatt, Daniel Dietz

Constructor Summary
CSVRetailerImporter()
           
 
Method Summary
protected  java.util.BitSet getRetailerFilter(java.lang.String[] data, int index, int size)
          Returns a BitSet filled with the data from the String at the given index of the given String array.
 int importAllRetailersFromFile(org.hibernate.Session s, java.io.File file, java.lang.String countryCode, ImportRetailerConfiguration conf)
          Imports the Retailers from the given File and stores them in the database.
 
Methods inherited from class org.torweg.pulse.component.util.retailer.imports.AbstractRetailerImporter
getRetailerLogo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CSVRetailerImporter

public CSVRetailerImporter()
Method Detail

importAllRetailersFromFile

public final int importAllRetailersFromFile(org.hibernate.Session s,
                                            java.io.File file,
                                            java.lang.String countryCode, ImportRetailerConfiguration conf)
                                     throws RetailerImporterException
Imports the Retailers from the given File and stores them in the database.

Specified by:
importAllRetailersFromFile in class AbstractRetailerImporter
Parameters:
s - the Session used for accessing the database.
file - the File containing the data.
countryCode - the country the Retailers have to be from.
conf - the current ImportRetailerConfiguration
Returns:
the amount of stored Retailers.
Throws:
RetailerImporterException - if an exception occurs while importing the Retailers.

getRetailerFilter

protected java.util.BitSet getRetailerFilter(java.lang.String[] data,
                                             int index,
                                             int size)
Returns a BitSet filled with the data from the String at the given index of the given String array.

Parameters:
data - the String array containing the data of the Retailer.
index - the index of the String used to fill the BitSet.
size - the size to be used for the BitSet
Returns:
a BitSet filled with the data from the String at the given index of the given String array.