[Batchserver-cvs] batchserver/src/org/jmonks/batchserver/io biller-file-spec.xml, NONE, 1.1 FileRea
Brought to you by:
suresh_pragada
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/io In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13799 Modified Files: FileReader.java FixedWidthFlatFileReader.java FixedWidthFlatFileRecordSpec.java Added Files: biller-file-spec.xml Log Message: no message Index: FileReader.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/io/FileReader.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FileReader.java 2 Jun 2006 21:02:06 -0000 1.3 --- FileReader.java 2 Jun 2006 22:27:22 -0000 1.4 *************** *** 35,39 **** throw new IllegalArgumentException("Absolute file path to read the file spec cannot be null."); else if(!(new File(absoluteFileSpecPath).exists() && new File(absoluteFileSpecPath).isFile())) ! throw new IllegalArgumentException("Absolute file path to read the file spec should exist and should be a file. Given absolute file spec path = " + absoluteFilePath); FileSpec fileSpec=FileSpec.createFileSpec(absoluteFileSpecPath); --- 35,39 ---- throw new IllegalArgumentException("Absolute file path to read the file spec cannot be null."); else if(!(new File(absoluteFileSpecPath).exists() && new File(absoluteFileSpecPath).isFile())) ! throw new IllegalArgumentException("Absolute file path to read the file spec should exist and should be a file. Given absolute file spec path = " + absoluteFileSpecPath); FileSpec fileSpec=FileSpec.createFileSpec(absoluteFileSpecPath); Index: FixedWidthFlatFileReader.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/io/FixedWidthFlatFileReader.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** FixedWidthFlatFileReader.java 2 Jun 2006 21:02:06 -0000 1.4 --- FixedWidthFlatFileReader.java 2 Jun 2006 22:27:22 -0000 1.5 *************** *** 12,19 **** import java.io.BufferedReader; ! import java.io.File; ! import java.io.FileInputStream; import java.io.IOException; - import java.io.InputStreamReader; import java.util.HashMap; import java.util.Iterator; --- 12,17 ---- import java.io.BufferedReader; ! import java.io.FileNotFoundException; import java.io.IOException; import java.util.HashMap; import java.util.Iterator; *************** *** 43,47 **** try { ! reader=new BufferedReader(new InputStreamReader(new FileInputStream(new File(this.absoluteFilePath)))); } catch(IOException exception) --- 41,52 ---- try { ! reader=new BufferedReader(new java.io.FileReader(this.absoluteFilePath)); ! } ! catch(FileNotFoundException exception) ! { ! reader=null; ! exception.printStackTrace(); ! logger.fatal("File could not be found to create the reader. Message = " + exception.getMessage(),exception); ! throw new FileParseException("File could not be found to create the reader. Message = " + exception.getMessage()); } catch(IOException exception) *************** *** 65,68 **** --- 70,74 ---- if(recordString==null) { + this.reader.close(); this.reader=null; return null; --- NEW FILE: biller-file-spec.xml --- <?xml version="1.0" encoding="UTF-8"?> <file-spec file-type="xml" root-element="biller"> <record-spec record-type="header" element-xpath="/biller/header"/> <record-spec record-type="detail" element-xpath="/biller/billerinfo"/> <record-spec record-type="trailor" element-xpath="/biller/trailor"/> </file-spec> Index: FixedWidthFlatFileRecordSpec.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/io/FixedWidthFlatFileRecordSpec.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FixedWidthFlatFileRecordSpec.java 2 Jun 2006 21:02:06 -0000 1.3 --- FixedWidthFlatFileRecordSpec.java 2 Jun 2006 22:27:22 -0000 1.4 *************** *** 48,52 **** RecordSpec recordSpec=new FixedWidthFlatFileRecordSpec(recordType); String startsWith=recordSpecElement.getAttribute(FixedWidthFlatFileRecordSpec.STARTS_WITH_ATTRIB_NAME); ! if(startsWith!=null && startsWith.trim().equals("")) ((FixedWidthFlatFileRecordSpec)recordSpec).startsWith=startsWith.trim(); else --- 48,52 ---- RecordSpec recordSpec=new FixedWidthFlatFileRecordSpec(recordType); String startsWith=recordSpecElement.getAttribute(FixedWidthFlatFileRecordSpec.STARTS_WITH_ATTRIB_NAME); ! if(startsWith!=null && !"".equals(startsWith.trim())) ((FixedWidthFlatFileRecordSpec)recordSpec).startsWith=startsWith.trim(); else |