org.pentaho.platform.dataaccess.datasource.wizard.csv
Class CsvModelService

java.lang.Object
  extended by org.pentaho.platform.engine.core.system.PentahoBase
      extended by org.pentaho.platform.dataaccess.datasource.wizard.csv.CsvModelService
All Implemented Interfaces:
Serializable, ILogger

public class CsvModelService
extends PentahoBase

See Also:
Serialized Form

Field Summary
static String DEFAULT_RELATIVE_UPLOAD_FILE_PATH
           
static List<String> NUMBER_FORMATS
           
static String TMP_FILE_PATH
           
 
Fields inherited from class org.pentaho.platform.engine.core.system.PentahoBase
EMPTYLOGID, LOGID_MASK1, LOGID_MASK2, LOGID_SEPARATOR
 
Fields inherited from interface org.pentaho.platform.api.engine.ILogger
ACTIVITY_LOG, DEBUG, ERROR, FATAL, INFO, INSTANCE_LOG, SESSION_LOG, SOLUTION_LOG, TRACE, UNKNOWN, WARN
 
Constructor Summary
CsvModelService()
           
 
Method Summary
 ModelInfo generateFields(String project, String filename, int rowLimit, String delimiter, String enclosure, int headerRows, boolean doData, boolean doColumns, String encoding)
           
 String getEncoding(String fileName)
           
 ModelInfo getFileContents(String project, String name, String delimiter, String enclosure, int rows, boolean isFirstRowHeader, String encoding)
           
 org.apache.commons.logging.Log getLogger()
           
 ModelInfo getModelInfo(String project, String filename)
           
 void saveModelInfo(ModelInfo modelInfo)
           
 
Methods inherited from class org.pentaho.platform.engine.core.system.PentahoBase
debug, debug, error, error, fatal, fatal, genLogIdFromInfo, genLogIdFromInfo, genLogIdFromSession, getLoggingLevel, getLogId, getObjectName, info, info, setLoggingLevel, setLogId, trace, trace, warn, warn
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NUMBER_FORMATS

public static final List<String> NUMBER_FORMATS

DEFAULT_RELATIVE_UPLOAD_FILE_PATH

public static final String DEFAULT_RELATIVE_UPLOAD_FILE_PATH

TMP_FILE_PATH

public static final String TMP_FILE_PATH
Constructor Detail

CsvModelService

public CsvModelService()
Method Detail

getFileContents

public ModelInfo getFileContents(String project,
                                 String name,
                                 String delimiter,
                                 String enclosure,
                                 int rows,
                                 boolean isFirstRowHeader,
                                 String encoding)
                          throws Exception
Throws:
Exception

generateFields

public ModelInfo generateFields(String project,
                                String filename,
                                int rowLimit,
                                String delimiter,
                                String enclosure,
                                int headerRows,
                                boolean doData,
                                boolean doColumns,
                                String encoding)
                         throws Exception
Throws:
Exception

getLogger

public org.apache.commons.logging.Log getLogger()
Specified by:
getLogger in class PentahoBase

getEncoding

public String getEncoding(String fileName)
                   throws Exception
Throws:
Exception

saveModelInfo

public void saveModelInfo(ModelInfo modelInfo)
                   throws IOException
Throws:
IOException

getModelInfo

public ModelInfo getModelInfo(String project,
                              String filename)
                       throws FileNotFoundException
Throws:
FileNotFoundException