net.sourceforge.jdbcimporter.columntranslator
Class FileToStringColumnTranslator

java.lang.Object
  extended bynet.sourceforge.jdbcimporter.columntranslator.FileToStringColumnTranslator
All Implemented Interfaces:
ColumnTranslator

public class FileToStringColumnTranslator
extends java.lang.Object
implements ColumnTranslator

The FileToStringColumnTranslator translates an InputStream into a filename by writing the contents of the InputStream into a file. The format of the filename will be '[prefix][number][suffix]' where 'prefix' and 'suffix' can be specified by the user and 'number' is a sequence number.

Version:
0.64
Author:
Chris Nagy

Field Summary
protected  java.lang.String baseDir
          The directory that the file wile reside in.
protected  int count
          The sequence number.
protected  java.lang.String filenamePrefix
          The filename prefix (default 'file').
protected  java.lang.String filenameSuffix
          The filename suffix.
protected static org.apache.commons.logging.Log LOG
          The log for error information.
 
Constructor Summary
FileToStringColumnTranslator()
           
 
Method Summary
 ColumnValue getValue(ColumnDef column, ColumnValue columnValue)
          Returns the translated column value.
 void setBaseDir(java.lang.String newBaseDir)
          Sets the base directory that the files will reside in.
 void setFilenamePrefix(java.lang.String newFilenamePrefix)
          Sets the filename prefix for all files created.
 void setFilenameSuffix(java.lang.String newFilenameSuffix)
          Sets the filename suffix for all files created.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

protected static org.apache.commons.logging.Log LOG
The log for error information.


baseDir

protected java.lang.String baseDir
The directory that the file wile reside in.


filenamePrefix

protected java.lang.String filenamePrefix
The filename prefix (default 'file').


filenameSuffix

protected java.lang.String filenameSuffix
The filename suffix.


count

protected int count
The sequence number.

Constructor Detail

FileToStringColumnTranslator

public FileToStringColumnTranslator()
Method Detail

setBaseDir

public void setBaseDir(java.lang.String newBaseDir)
Sets the base directory that the files will reside in.

Parameters:
newBaseDir - the directory

setFilenamePrefix

public void setFilenamePrefix(java.lang.String newFilenamePrefix)
Sets the filename prefix for all files created.

Parameters:
newFilenamePrefix - the prefix

setFilenameSuffix

public void setFilenameSuffix(java.lang.String newFilenameSuffix)
Sets the filename suffix for all files created.

Parameters:
newFilenameSuffix - the suffix

getValue

public ColumnValue getValue(ColumnDef column,
                            ColumnValue columnValue)
Description copied from interface: ColumnTranslator
Returns the translated column value.

Specified by:
getValue in interface ColumnTranslator
Parameters:
column - the definition of the column
columnValue - the value of the column read from a file
Returns:
the new value of the column
See Also:
ColumnTranslator.getValue(net.sourceforge.jdbcimporter.ColumnDef, net.sourceforge.jdbcimporter.ColumnValue)