Changeset 4102
- Timestamp:
- Jan 28, 2008, 11:07:20 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/plugins/core/net/sf/basedb/plugins/AbstractFlatFileImporter.java
r4101 r4102 576 576 } 577 577 FlatFileParser.LineType result = ffp.parseHeaders(); 578 if (result == FlatFileParser.LineType.UNKNOWN) return;579 578 FlatFileParser.Line line = null; 580 579 try … … 611 610 " on line " + (line == null ? "-1" : line.lineNo() + ": " + StringUtil.trimString(line.line(), 20)), t); 612 611 } 613 if (progress != null) progress.display(getProgress(ffp), "Parsing data..."); 614 int progressLine = 0; 615 616 beginData(); 617 try 612 if (result == FlatFileParser.LineType.DATA || result == FlatFileParser.LineType.DATA_HEADER) 618 613 { 619 while (ffp.hasMoreData()) 614 if (progress != null) progress.display(getProgress(ffp), "Parsing data..."); 615 int progressLine = 0; 616 617 beginData(); 618 try 620 619 { 621 dataline = ffp.nextData(); 622 try 620 while (ffp.hasMoreData()) 623 621 { 624 handleData(dataline); 622 dataline = ffp.nextData(); 623 try 624 { 625 handleData(dataline); 626 } 627 catch (Throwable t) 628 { 629 if (errorHandler == null) 630 { 631 throw t; 632 } 633 else 634 { 635 errorHandler.handleError(t); 636 } 637 skippedLines++; 638 } 639 progressLine++; 640 if (progressLine == 100) 641 { 642 progressLine = 0; 643 if (progress != null) 644 { 645 progress.display(getProgress(ffp), "Parsing data... (" + ffp.getParsedLines() + " lines so far)"); 646 } 647 } 648 // In case the server is shutting down... throw exception, rollback and quit 649 if (Thread.interrupted()) throw new SignalException("Aborted by user."); 625 650 } 626 catch (Throwable t)627 {628 if (errorHandler == null)629 {630 throw t;631 }632 else633 {634 errorHandler.handleError(t);635 }636 skippedLines++;637 }638 progressLine++;639 if (progressLine == 100)640 {641 progressLine = 0;642 if (progress != null)643 {644 progress.display(getProgress(ffp), "Parsing data... (" + ffp.getParsedLines() + " lines so far)");645 }646 }647 // In case the server is shutting down... throw exception, rollback and quit648 if (Thread.interrupted()) throw new SignalException("Aborted by user.");649 651 } 650 }651 catch (Throwable t)652 {653 throw new BaseException(t.getMessage() +654 " on line " + (dataline == null ? "-1" : dataline.lineNo() + ": " + StringUtil.trimString(dataline.line(), 20)), t);652 catch (Throwable t) 653 { 654 throw new BaseException(t.getMessage() + 655 " on line " + (dataline == null ? "-1" : dataline.lineNo() + ": " + StringUtil.trimString(dataline.line(), 20)), t); 656 } 655 657 } 656 658 }
Note: See TracChangeset
for help on using the changeset viewer.