try {
File file = chooser.getSelectedFile();
String fileName = file.getName().toUpperCase();
BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(file)));
if (fileName.indexOf(".OFX")>=0 || fileName.indexOf(".QFX")>=0) {
OFXParser parser = new OFXParser();
parser.parse(this.currentAccount.getAccountID(), reader);
}
else if (fileName.indexOf(".QIF")>=0) {
QIFParser parser = new QIFParser();
parser.parse(this.currentAccount.getAccountID(), reader);
}
reader.close();
}
catch (Exception ex) {
throw new RuntimeException(ex);