public class CDataSourceFileMgr extends java.lang.Object implements IDataSource
Modifier and Type | Field and Description |
---|---|
protected CManagedFile |
m_crtFile
This member represents the file currently being processed.
|
protected static int |
m_debugLevel |
protected CFileMgr |
m_fileMgr
This member is used to manage files to be processed
|
protected ILogger |
m_iLogger
This member is used for reporting errors and warnings.
|
protected COSARReporter |
m_reporter
This member is used to send reports to.
|
EOF
Constructor and Description |
---|
CDataSourceFileMgr(java.lang.String inputDir,
java.lang.String scratchDir,
java.io.FilenameFilter filter,
ILogger iLogger) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
checkDir(java.lang.String dir) |
boolean |
cleanupCrtFile() |
COSARReporter |
COSARReporter() |
protected void |
debug(java.lang.String fName,
java.lang.String msg) |
boolean |
end()
Function called to end reading.
|
protected void |
error(java.lang.String fName,
java.lang.String msg) |
static int |
getDebugLevel() |
java.lang.String |
getSourceName() |
boolean |
hasMoreData() |
protected boolean |
initFileMgr(java.lang.String inputDir,
java.lang.String scratchDir,
java.io.FilenameFilter filter)
This function initializes the file manager.
|
boolean |
initialize()
This function is used to initialize the data source.
|
boolean |
isHealthy() |
char |
nextChar()
Function called to read a character from the input medium
|
int |
read(char[] buf,
int len)
This function reads a given number of characters from the source.
|
boolean |
setBookmark(int lineNo)
Function used to mark a position in the input medium
|
static void |
setDebugLevel(int debugLevel) |
void |
setDoneFilePrefix(java.lang.String prefix) |
void |
setDoneFileSuffix(java.lang.String suffix) |
void |
setReporter(COSARReporter reporter) |
boolean |
start()
Function called to start reading
|
boolean |
terminate()
This function is used to terminate the data source.
|
protected static int m_debugLevel
protected ILogger m_iLogger
protected CFileMgr m_fileMgr
protected CManagedFile m_crtFile
protected COSARReporter m_reporter
public CDataSourceFileMgr(java.lang.String inputDir, java.lang.String scratchDir, java.io.FilenameFilter filter, ILogger iLogger) throws java.lang.Exception
inputDir
- - directory to monitor for input filesscratchDir
- - scratch directoryfilter
- - identifies files to returniLogger
- - object to handle errors and warningsjava.lang.Exception
public static int getDebugLevel()
public COSARReporter COSARReporter()
public static void setDebugLevel(int debugLevel)
public void setReporter(COSARReporter reporter)
public void setDoneFilePrefix(java.lang.String prefix)
public void setDoneFileSuffix(java.lang.String suffix)
public java.lang.String getSourceName()
getSourceName
in interface IDataSource
public boolean hasMoreData()
hasMoreData
in interface IDataSource
public char nextChar() throws java.lang.Exception
If there is a current file to process, the character is retrieved from this file, otherwise the next file is selected for processing.
nextChar
in interface IDataSource
java.lang.Exception
public int read(char[] buf, int len) throws java.lang.Exception
IDataSource
read
in interface IDataSource
java.lang.Exception
public boolean initialize()
initialize
in interface IDataSource
public boolean terminate()
terminate
in interface IDataSource
public boolean start()
start
in interface IDataSource
public boolean end()
end
in interface IDataSource
public boolean setBookmark(int lineNo)
setBookmark
in interface IDataSource
public boolean cleanupCrtFile()
public boolean isHealthy()
isHealthy
in interface IDataSource
protected boolean initFileMgr(java.lang.String inputDir, java.lang.String scratchDir, java.io.FilenameFilter filter)
protected boolean checkDir(java.lang.String dir)
protected void error(java.lang.String fName, java.lang.String msg)
protected void debug(java.lang.String fName, java.lang.String msg)