我只想问一下如何获取从另一页保存的文件的名称
这是代码
DPFPVerificationResult result =
verificator.verify(features, ((Main)getOwner()).getTemplate());
updateStatus(result.getFalseAcceptRate());
if (result.isVerified())
makeReport("The fingerprint is from" (should be the name of the file name i saved".");
else
makeReport("The fingerprint can't be recognized. Please re-try.");
}
}
和另一个保存我想要的文件的页面
private void onLoad() {
JFileChooser chooser = new JFileChooser();
chooser.addChoosableFileFilter(new TemplateFileFilter());
if(chooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
try {
FileInputStream stream = new FileInputStream(chooser.getSelectedFile());
byte[] data = new byte[stream.available()];
stream.read(data);
stream.close();
DPFPTemplate t = DPFPGlobal.getTemplateFactory().createTemplate();
t.deserialize(data);
setTemplate(t);
} catch (Exception ex) {
JOptionPane.showMessageDialog(this, ex.getLocalizedMessage(), "Fingerprint loading", JOptionPane.ERROR_MESSAGE);
}
}
}
我想获取由数据实例化的文件的名称,然后我将转换为字符串并拆分以获取名称