}
protected void initCT() {
try {
TerminalFactory terminalFactory = TerminalFactory.getDefault();
CardTerminals terminals = terminalFactory.terminals();
if (terminals == null)
throw new HBCI_Exception("Kein Kartenleser gefunden");
List<CardTerminal> list = terminals.list();
if (list == null || list.size() == 0)
throw new HBCI_Exception("Kein Kartenleser gefunden");
HBCIUtils.log("found card terminals:", HBCIUtils.LOG_INFO);
for (CardTerminal t : list) {
HBCIUtils.log(" " + t.getName(), HBCIUtils.LOG_INFO);
}
CardTerminal terminal = null;
// Checken, ob der User einen konkreten Kartenleser vorgegeben hat
String name = HBCIUtils.getParam(getParamHeader() + ".pcsc.name", null);
if (name != null) {
HBCIUtils.log("explicit terminal name given, trying to open terminal: " + name, HBCIUtils.LOG_DEBUG);
terminal = terminals.getTerminal(name);
if (terminal == null)
throw new HBCI_Exception("Kartenleser \"" + name + "\" nicht gefunden");
} else {
HBCIUtils.log("open first available card terminal", HBCIUtils.LOG_DEBUG);
terminal = list.get(0);