- Timestamp:
- 2003-06-12T12:38:05+12:00 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/gui/OptionsPane.java
r4367 r4596 659 659 return d.toString(); 660 660 } 661 /** extracts the date from the file name */661 /** extracts the date from the file name, which is of the form 'build_log.'<long>[scu]'.txt' */ 662 662 private Date getDateFromFileName() { 663 663 String name = this.file.getName(); 664 String date_string = name.substring(10, 23);//name.length()-4); 665 return new Date(Long.parseLong(date_string)); 664 // Need to exclude first '.' 665 int first_index = name.indexOf(".") + 1; 666 // Need to exclude state letter before last '.' 667 int last_index = name.lastIndexOf(".") - 1; 668 if(first_index > 0 && last_index > 0 && first_index < last_index) { 669 String date_string = name.substring(first_index, last_index); 670 return new Date(Long.parseLong(date_string)); 671 } 672 else { 673 return new Date(); // Current date 674 } 666 675 } 667 676
Note:
See TracChangeset
for help on using the changeset viewer.