Package com.nt.udc.io

Class CStringDataSink

java.lang.Object
com.nt.udc.io.CStringDataSink
All Implemented Interfaces:
IDataSink

public class CStringDataSink extends Object implements IDataSink
This class is used to write data into files in a specified output directory.
Since:
JDK1.1.7
  • Field Details

    • m_debugLevel

      protected static int m_debugLevel
    • m_iLogger

      protected ILogger m_iLogger
      This member is used for reporting errors and warnings.
    • m_scratchDir

      protected String m_scratchDir
      This member represents the scratch directory
    • m_outputDir

      protected String m_outputDir
      This member represents the directory files are eventually written to.
    • m_outFile

      protected File m_outFile
      This member represents the output filename.
    • m_writer

      protected FileWriter m_writer
      This member represents the writer.
    • m_filePrefix

      protected String m_filePrefix
      This member represents the output file prefix.
    • m_fileSuffix

      protected String m_fileSuffix
      This member represents the output file suffix.
    • m_maxRecordsPerFile

      protected int m_maxRecordsPerFile
      This member represents the maximum records to be written to a file.
    • m_currentRecNo

      protected int m_currentRecNo
      This member represents the current record number.
    • m_filenameGen

      protected FilenameGenerator m_filenameGen
      This member is used to generate filenames.
  • Constructor Details

    • CStringDataSink

      public CStringDataSink(String scratchDir, String outputDir, ILogger iLogger)
  • Method Details

    • getDebugLevel

      public static int getDebugLevel()
    • getScratchDir

      public String getScratchDir()
    • getOutputDir

      public String getOutputDir()
    • getFilePrefix

      public String getFilePrefix()
    • getFileSuffix

      public String getFileSuffix()
    • getMaxRecordsPerFile

      public int getMaxRecordsPerFile()
    • setDebugLevel

      public static void setDebugLevel(int debugLevel)
    • setFilePrefix

      public void setFilePrefix(String filePrefix)
    • setFileSuffix

      public void setFileSuffix(String fileSuffix)
    • setMaxRecordsPerFile

      public void setMaxRecordsPerFile(int maxRecordsPerFile)
    • setFilenameGenerator

      public final void setFilenameGenerator(FilenameGenerator filenameGen)
    • writeData

      public boolean writeData(Object data)
      This function is called to write a string to the output medium.
      Specified by:
      writeData in interface IDataSink
      Returns:
      true if successful, false otherwise
    • start

      public boolean start()
      This function is called to start writing.
      Specified by:
      start in interface IDataSink
      Returns:
      true if successful, false otherwise
    • stop

      public boolean stop()
      This function is called to stop writing.
      Specified by:
      stop in interface IDataSink
      Returns:
      true if successful, false otherwise
    • getNewFilename

      protected String getNewFilename()
      This function is used to return a new filename unique to the current output directory.
      Returns:
      true if successful, false otherwise
    • error

      protected void error(String fName, String msg)
    • debug

      protected void debug(String fName, String msg)