public Object getTarget() {
        try {
            checkPermission(READ);
        } catch (AccessDeniedException e) {
            String rest = Stapler.getCurrentRequest().getRestOfPath();
            for (String name : ALWAYS_READABLE_PATHS) {
                if (rest.startsWith(name)) {
                    return this;
                }
            }
            for (String name : getUnprotectedRootActions()) {
                if (rest.startsWith("/" + name + "/") || rest.equals("/" + name)) {
                    return this;
                }
            }
            // TODO SlaveComputer.doSlaveAgentJnlp; there should be an annotation to request unprotected access
            if (rest.matches("/computer/[^/]+/slave-agent[.]jnlp")
                && "true".equals(Stapler.getCurrentRequest().getParameter("encrypt"))) {
                return this;
            }
            throw e;
        }
        return this;
    }
public Object getTarget() {
        try {
            checkPermission(READ);
        } catch (AccessDeniedException e) {
            String rest = Stapler.getCurrentRequest().getRestOfPath();
            for (String name : ALWAYS_READABLE_PATHS) {
                if (rest.startsWith(name)) {
                    return this;
                }
            }
            for (String name : getUnprotectedRootActions()) {
                if (rest.startsWith("/" + name + "/") || rest.equals("/" + name)) {
                    return this;
                }
            }
           
            if (rest.matches("/computer/[^/]+/slave-agent[.]jnlp")
                && "true".equals(Stapler.getCurrentRequest().getParameter("encrypt"))) {
                return this;
            }
            throw e;
        }
        return this;
    }
public object gettarget() { try { checkpermission(read); } catch (accessdeniedexception e) { string rest = stapler.getcurrentrequest().getrestofpath(); for (string name : always_readable_paths) { if (rest.startswith(name)) { return this; } } for (string name : getunprotectedrootactions()) { if (rest.startswith("/" + name + "/") || rest.equals("/" + name)) { return this; } } if (rest.matches("/computer/[^/]+/slave-agent[.]jnlp") && "true".equals(stapler.getcurrentrequest().getparameter("encrypt"))) { return this; } throw e; } return this; }