Package uk.co.nimp.scard

Examples of uk.co.nimp.scard.StarScriptReader


    public boolean processArg(Arg arg, CommandLine cl) {
        File in=arg.getFile(arg.value.substring(ARG_STAR_SCRIPT_FILE.length()));
        try {
            List<? extends Object> cmds;
            terminal.logLine(ScardLogHandler.LOG_INFO, "SCRIPT: "+in.getCanonicalPath());
            StarScriptReader script = new StarScriptReader(in);
            cmds = script.getCmds();

            scriptPlayer.setnRun(nRun);
            scriptPlayer.play(terminal, cmds);
            if(null==error){
                if (scriptPlayer.isErrorOccured())
View Full Code Here


            File scriptFile=arg.getSingleFile(ARG_SET_BEFORE_DISCONNECT_SCRIPT);
            if(null==scriptFile)
                terminal.setBeforeDisconnectScript(null);
            else{
                try {
                    StarScriptReader reader = new StarScriptReader(scriptFile);
                    terminal.setBeforeDisconnectScript(reader.getCmds());
                } catch (Throwable ex) {
                    throw new InvalidCommandLineException(ex);
                }
            }
        }else if(arg.value.startsWith(ARG_SET_BEFORE_CONNECT_SCRIPT)){
            File scriptFile=arg.getSingleFile(ARG_SET_BEFORE_CONNECT_SCRIPT);
            if(null==scriptFile)
                terminal.setBeforeConnectScript(null);
            else{
                try {
                    StarScriptReader reader = new StarScriptReader(scriptFile);
                    terminal.setBeforeConnectScript(reader.getCmds());
                } catch (Throwable ex) {
                    throw new InvalidCommandLineException(ex);
                }
            }
        }else if(arg.value.startsWith(ARG_SET_AFTER_CONNECT_SCRIPT)){
           
            File scriptFile=arg.getSingleFile(ARG_SET_AFTER_CONNECT_SCRIPT);
            if(null==scriptFile){
                terminal.setAfterConnectScript(null);
                System.out.println("Set After connect script to null");
            } else {
                try {
                    System.out.println("Set After connect script to " + scriptFile.getCanonicalPath());
                } catch (IOException ex) {
                    Logger.getLogger(TerminalArgHandler.class.getName()).log(Level.SEVERE, null, ex);
                }
                try {
                    StarScriptReader reader = new StarScriptReader(scriptFile);
                    System.out.println("After connect script has " + reader.getCmds().size() + " objects");
                    terminal.setAfterConnectScript(reader.getCmds());
                } catch (Throwable ex) {
                    throw new InvalidCommandLineException(ex);
                }
            }
        }else if(arg.value.startsWith(ARG_SET_UNEXPECTED_CARD_RESPONSE_SCRIPT)){
            File scriptFile=arg.getSingleFile(ARG_SET_UNEXPECTED_CARD_RESPONSE_SCRIPT);
            if(null==scriptFile)
                terminal.setUnexpectedCardResponseScript(null);
            else{
                try {
                    StarScriptReader reader = new StarScriptReader(scriptFile);
                    terminal.setUnexpectedCardResponseScript(reader.getCmds());
                } catch (Throwable ex) {
                    throw new InvalidCommandLineException(ex);
                }
            }
        /*}else if(arg.value.startsWith(ARG_SET_UNEXPECTED_CARD_RESPONSE_RESUME_SCRIPT)){
            File scriptFile=arg.getSingleFile(ARG_SET_UNEXPECTED_CARD_RESPONSE_RESUME_SCRIPT);
            if(null==scriptFile)
                terminal.setUnexpectedCardResponseResumingScript(null);
            else{
                try {
                    StarScriptReader reader = new StarScriptReader(scriptFile);
                    terminal.setUnexpectedCardResponseResumingScript(reader.getCmds());
                } catch (Throwable ex) {
                    throw new InvalidCommandLineException(ex);
                }
            }*/
        }else if(arg.value.startsWith(ARG_SET_APDU_TIMEOUT_SCRIPT)){
            File scriptFile=arg.getSingleFile(ARG_SET_APDU_TIMEOUT_SCRIPT);
            if(null==scriptFile)
                terminal.setApduTimeoutScript(null);
            else{
                try {
                    StarScriptReader reader = new StarScriptReader(scriptFile);
                    terminal.setApduTimeoutScript(reader.getCmds());
                } catch (Throwable ex) {
                    throw new InvalidCommandLineException(ex);
                }
            }
        }else if(arg.value.startsWith(ARG_SET_APDU_MISC_ERROR_SCRIPT)){
            File scriptFile=arg.getSingleFile(ARG_SET_APDU_MISC_ERROR_SCRIPT);
            if(null==scriptFile)
                terminal.setApduMiscErrorScript(null);
            else{
                try {
                    StarScriptReader reader = new StarScriptReader(scriptFile);
                    terminal.setApduMiscErrorScript(reader.getCmds());
                } catch (Throwable ex) {
                    throw new InvalidCommandLineException(ex);
                }
            }
        }else if(arg.value.startsWith(ARG_SET_TERM_ENV)){
View Full Code Here

TOP

Related Classes of uk.co.nimp.scard.StarScriptReader

Copyright © 2018 www.massapicom. 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.