5 Replies Latest reply: May 26, 2011 8:13 AM by EJP RSS

    Accessing codebase value in java policy file?

    864355
      Code being executed is always considered to come from a particular "code source" (represented by an object of type CodeSource). The code source includes not only the location (URL) where the code originated from, but also a reference to the certificate(s) containing the public key(s) corresponding to the private key(s) used to sign the code. Certificates in a code source are referenced by symbolic alias names from the user's keystore.

      Each grant entry includes one or more "permission entries" preceded by optional codeBase and signedBy name/value pairs that specify which code you want to grant the permissions. The basic format of a grant entry is the following:

      grant signedBy "signer_names", codeBase "URL" {
      permission permission_class_name "target_name", "action",
      signedBy "signer_names";
      ....
      permission permission_class_name "target_name", "action",
      signedBy "signer_names";
      };

      I want to access this codebase value(URL) in the policy file. Any way, aPI can be used? I read that it is represented by an object of type CodeSource. But how to access this object i didnt get that. Can you please help me with this?