com.digertech.sdk.reader
Class DTFileReader

java.lang.Object
  extended by com.digertech.sdk.reader.DTFileReader

public final class DTFileReader
extends java.lang.Object

Class DTFileReader reads the records from the Image Cash Letter(ICL) file. Any class requires the ICL records passed in should implement ProcessingInterface and call the readRecords(ProcessingInterface) metho of class DTFileReader.

Class DTFileReader is part of DigerTech Inc. file processing SDK. License key is required to performance the process. For each JVM, the method setLicenseKey should be called one and only one time which will validate the license key.

If the license key is valid, DTFileReader returns the valid product id of the license. Othwise a free version product id is returned. The following are all valid product id:

SDK_FREE
SDK_FILE_READER_DEVELOPER
SDK_FILE_READER_ENTERPRISE_I
SDK_FILE_READER_ENTERPRISE_II

After the ICL file is processed, the method close should be called to close the ICL file.


Field Summary
static int SDK_FILE_READER_DEVELOPER
           
static int SDK_FILE_READER_ENTERPRISE_I
           
static int SDK_FILE_READER_ENTERPRISE_II
           
static int SDK_FREE
           
 
Constructor Summary
DTFileReader(java.io.File file)
          Constructs a newly allocated DTFileReader that represents the ICL file reader.
DTFileReader(java.io.File file, int format)
          Constructs a newly allocated DTFileReader that represents the ICL file reader.
 
Method Summary
 void close()
          Close the ICL file.
static FPLicenseInfo getLicenseInfo()
          If a license key is set to the SDK and the license key is valid, the license info will be return after it is validated.
 void readRecords(ReaderInterface processInterface)
          Read records from the ICL file and pass records to the class implements ProcessingInterface by calling the processRecord(int recordType, X9Record record) method in the class.
static int setLicenseKey(java.lang.String licenseKey)
          Set the license key to the SDK to validate the license.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SDK_FREE

public static final int SDK_FREE
See Also:
Constant Field Values

SDK_FILE_READER_DEVELOPER

public static final int SDK_FILE_READER_DEVELOPER
See Also:
Constant Field Values

SDK_FILE_READER_ENTERPRISE_I

public static final int SDK_FILE_READER_ENTERPRISE_I
See Also:
Constant Field Values

SDK_FILE_READER_ENTERPRISE_II

public static final int SDK_FILE_READER_ENTERPRISE_II
See Also:
Constant Field Values
Constructor Detail

DTFileReader

public DTFileReader(java.io.File file)
             throws FileIOException
Constructs a newly allocated DTFileReader that represents the ICL file reader.

Parameters:
file - the image cash letter file.
Throws:
FileIOException - if there is an error initialize the file reader.

DTFileReader

public DTFileReader(java.io.File file,
                    int format)
             throws FileIOException
Constructs a newly allocated DTFileReader that represents the ICL file reader.

Parameters:
file - the image cash letter file.
format - the image cash letter file format.
Throws:
FileIOException - if there is an error initialize the file reader.
Method Detail

close

public void close()
           throws FileIOException
Close the ICL file. This method should be called after the file is processed.

Throws:
FileIOException - if there is an error closing the file.

readRecords

public final void readRecords(ReaderInterface processInterface)
                       throws FileIOException
Read records from the ICL file and pass records to the class implements ProcessingInterface by calling the processRecord(int recordType, X9Record record) method in the class.

Parameters:
processInterface - interface which the class processes the records.
Throws:
FileIOException - if there an error read records from the ICL file.

setLicenseKey

public static int setLicenseKey(java.lang.String licenseKey)
Set the license key to the SDK to validate the license. If the license key is valid, a valid product id of the license will be returned. Othwise a free version productId is returned. The following are all valid product id:

SDK_FREE
SDK_FILE_READER_DEVELOPER
SDK_FILE_READER_ENTERPRISE_I
SDK_FILE_READER_ENTERPRISE_II


getLicenseInfo

public static FPLicenseInfo getLicenseInfo()
If a license key is set to the SDK and the license key is valid, the license info will be return after it is validated. The license info contains product id of if the license is valid. Othwise a free version productId is returned. The following are all valid product id:

SDK_FREE
SDK_FILE_PROCESS_DEVELOPER
SDK_FILE_PROCESS_ENTERPRISE_I
SDK_FILE_PROCESS_ENTERPRISE_II