Package javax.smartcardio

Examples of javax.smartcardio.CardTerminals.list()


  public static boolean isSmartcardPlugged() throws Exception
  {
    TerminalFactory factory = TerminalFactory.getDefault();
    CardTerminals terminals = factory.terminals();
    //for(CardTerminal terminal : terminals.list(CardTerminals.State.CARD_INSERTION))
    for(CardTerminal terminal : terminals.list())
    {
      if(terminal.isCardPresent())
        return true;
    }
    return false;
View Full Code Here


      Utilities.writeToLogs(home,"[E] "+e.toString());     
    }
    try {
      tf = TerminalFactory.getDefault();
      ct = tf.terminals();
      cs = ct.list(CardTerminals.State.CARD_PRESENT);
      if (cs.isEmpty()){
        Utilities.writeToLogs(home,"[E] No terminal with a card found!");
        System.out.println("[-] No terminal with a card found!");
        return;
      }
View Full Code Here

      Utilities.writeToLogs(home,"[E] "+e.toString());     
    }
    try {
      tf = TerminalFactory.getDefault();
      ct = tf.terminals();
      cs = ct.list(CardTerminals.State.CARD_PRESENT);
      if (cs.isEmpty()){
        Utilities.writeToLogs(home,"[E] No terminal with a card found!");
        System.out.println("[-] No terminal with a card found!");
        return;
      }
View Full Code Here

        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) {
View Full Code Here

            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) {
View Full Code Here

            TerminalFactory factory = TerminalFactory.getDefault();
            System.out.println("TerminalFactory: " + factory);

            CardTerminals terminals = factory.terminals();

            List<CardTerminal> terminalList = terminals.list();
            if(terminalList.size() == 0) {
                System.out.println("No terminals found");
                return;
            }
            System.out.println("Terminal list: " + terminalList);
View Full Code Here

    }

    public synchronized List<CardTerminal> getTerminals() throws CardException {
        CardTerminals term = attach();
        if(term != null) {
            return term.list();
        }
        return new LinkedList<CardTerminal>();
    }

    /**
 
View Full Code Here

     * @throws CardException
     */
    public synchronized List<CardTerminal> getTerminalsWithCard() throws CardException {
        CardTerminals term = attach();
        if(term != null) {
            return term.list(CardTerminals.State.CARD_PRESENT);
        }
        return new LinkedList<CardTerminal>();
    }


View Full Code Here

    public List<CardTerminal> waitForEvent(long timeout) throws CardException {
        CardTerminals term = attach();
        if (term != null && term.waitForChange(timeout)) {
            try {
                List<CardTerminal> all = new ArrayList<CardTerminal>();
                List<CardTerminal> inserted = term.list(CardTerminals.State.CARD_INSERTION);
                List<CardTerminal> removed = term.list(CardTerminals.State.CARD_REMOVAL);
                if(inserted != null) {
                    for (CardTerminal cardTerminal : inserted) {
                        System.out.println("insert card in: " + cardTerminal.getName());
                    }
View Full Code Here

        CardTerminals term = attach();
        if (term != null && term.waitForChange(timeout)) {
            try {
                List<CardTerminal> all = new ArrayList<CardTerminal>();
                List<CardTerminal> inserted = term.list(CardTerminals.State.CARD_INSERTION);
                List<CardTerminal> removed = term.list(CardTerminals.State.CARD_REMOVAL);
                if(inserted != null) {
                    for (CardTerminal cardTerminal : inserted) {
                        System.out.println("insert card in: " + cardTerminal.getName());
                    }
                    all.addAll(inserted);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.