@Override
    public void perform(ISConnection connection, Map<String, String> params) {
        fakulta = params.get("fakulta");
        obdobi = params.get("obdobi");
        predmet = params.get("predmet");
        // URL encode a vstupni kodovani!
        nbloku = params.get("nbloku");

        // no idea where this comes from
        exppar = "a";

        List<String> keys = new LinkedList<String>();
        keys.add("fakulta");
        keys.add("obdobi");
        keys.add("predmet");
        keys.add("nbloku");
        keys.add("file");
        keys.add("slid");
        keys.add("slho");
        keys.add("ostry");

        boolean failed = false;

        for (String key:keys) {
            if (params.get(key) == null) {
                System.out.println("The '-D"+ key + "' Additional parameter is not specified.");
                failed = true;
            }
        }

        File file = null;
        if (params.get("file") != null) {
            file = new File(params.get("file"));
            if (!file.exists()) {
                System.out.println("File '" + params.get("file") + "' does not exist.");
                failed = true;
            }
        }

        if (failed) {
            System.out.println("Some of the required Additional parameters is not specified correctly.\nUse --parameters together with the --action to see the list.");
            return;
        }

        String magicNumber;

        HttpGet openForm = OpenForm();
        String form = connection.performRequest(openForm);
        magicNumber = ISConnection.ExtractMagicNumber(form);
        if(CLI.DEBUG) {
            System.out.println(magicNumber);
        }

        HttpPost mySelectBlock = selectBlock(magicNumber);
        String block = connection.performRequest(mySelectBlock);
        magicNumber = ISConnection.ExtractMagicNumber(block);
        if(CLI.DEBUG) {
            System.out.println(magicNumber);
//          System.out.println(block);
        }

        HttpPost request = SendGradesFile(file,
                params.get("slid"),
                params.get("slho"),
                params.get("nerozlisovat_bloky"),
                params.get("ostry"),
                magicNumber);
        String status = connection.performRequest(request);
        if(CLI.DEBUG) {
            System.out.println(status);
        }
        String msg = ISConnection.ExtractMessage(status);
        if (msg != null) {
            System.out.println(msg);
        } else {
            System.out.println("Processing finished. Could not parse status message.");
            CLI.ExitWithDisclaimer();
        }
    }