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

net::sourceforge::jnlp::Parser::Parser ( JNLPFile  file,
URL  base,
Node  root,
boolean  strict,
boolean  allowExtensions 
) throws ParseException [inline]

Create a parser for the JNLP file. If the location parameters is not null it is used as the default codebase (does not override value of jnlp element's href attribute).

The root node may be normalized as a side effect of this constructor.

file the (uninitialized) file reference
base if codebase is not specified, a default base for relative URLs
root the root node
strict whether to enforce strict compliance with the JNLP spec
allowExtensions whether to allow extensions to the JNLP spec
ParseException if the JNLP file is invalid

Definition at line 124 of file Parser.java.

References addSlash(), allowExtensions, base, codebase, file, fileLocation, net::sourceforge::jnlp::Node::getNodeName(), getURL(), getVersion(), net::sourceforge::jnlp::Version::matchesAny(), net::sourceforge::jnlp::Node::normalize(), root, spec, strict, and supportedVersions.

        this.file = file;
        this.root = root;
        this.strict = strict;
        this.allowExtensions = allowExtensions;

        // ensure it's a JNLP node
        if (root == null || !root.getNodeName().equals("jnlp"))
            throw new ParseException(R("PInvalidRoot"));

        // JNLP tag information
        this.spec = getVersion(root, "spec", "1.0+");
        this.codebase = addSlash(getURL(root, "codebase", base));
        this.base = (codebase!=null) ? codebase : base; // if codebase not specified use default codebase
        fileLocation = getURL(root, "href", this.base);

        // ensure version is supported
        if (!supportedVersions.matchesAny(spec))
            throw new ParseException(R("PSpecUnsupported", supportedVersions));

        // normalize the text nodes

Generated by  Doxygen 1.6.0   Back to index