Logo Search packages:      
Sourcecode: icedtea-web version File versions  Download package

SecurityDesc net::sourceforge::jnlp::Parser::getSecurity ( Node  parent  )  throws ParseException [inline]

Returns the security descriptor element. If no security element was specified in the JNLP file then a SecurityDesc with applet permissions is returned.

Parameters:
parent the parent node
Exceptions:
ParseException if the JNLP file is invalid

Definition at line 557 of file Parser.java.

References base, file, getChildNode(), getChildNodes(), and strict.

Referenced by net::sourceforge::jnlp::JNLPFile::parse().

                                                                       {
        Node nodes[] = getChildNodes(parent, "security");

        // test for too many security elements
        if (nodes.length > 1)
            if (strict)
                throw new ParseException(R("PTwoSecurity"));

        Object type = SecurityDesc.SANDBOX_PERMISSIONS;

        if (nodes.length == 0)
            type = SecurityDesc.SANDBOX_PERMISSIONS;
        else if (null != getChildNode(nodes[0], "all-permissions"))
            type = SecurityDesc.ALL_PERMISSIONS;
        else if (null != getChildNode(nodes[0], "j2ee-application-client-permissions"))
            type = SecurityDesc.J2EE_PERMISSIONS;
        else if (strict)
            throw new ParseException(R("PEmptySecurity"));

        if (base != null)
            return new SecurityDesc(file, type, base.getHost());
        else
            return new SecurityDesc(file, type, null);
    }


Generated by  Doxygen 1.6.0   Back to index