Package java.security

Examples of java.security.URIParameter


        } else {
            if (!(params instanceof URIParameter)) {
                throw new IllegalArgumentException
                        ("Unrecognized policy parameter: " + params);
            }
            URIParameter uriParam = (URIParameter)params;
            try {
                pf = new PolicyFile(uriParam.getURI().toURL());
            } catch (MalformedURLException mue) {
                throw new IllegalArgumentException("Invalid URIParameter", mue);
            }
        }
    }
View Full Code Here


    public static void main(String[] argv) throws Exception {

        // 1. Make sure the FileNotFoundException is hidden
        try {
            Configuration.getInstance("JavaLoginConfig", new URIParameter(new URI("file:///no/such/file")));
        } catch (NoSuchAlgorithmException nsae) {
            if (nsae.getCause() instanceof IOException &&
                    !(nsae.getCause() instanceof FileNotFoundException)) {
                // ignore
            } else {
View Full Code Here

        // the policy only grants this test SocketPermission to accept, resolve
        // and connect to localhost so that it can dereference 2nd reference
        URI policyURI =
            new File(System.getProperty("test.src", "."), "policy").toURI();
        Policy.setPolicy
            (Policy.getInstance("JavaPolicy", new URIParameter(policyURI)));
        System.setSecurityManager(new SecurityManager());

        try {
            // generate a signature with SecurityManager enabled
            ArrayList refs = new ArrayList();
View Full Code Here

        //find login file configuration from Storm configuration 
        String loginConfigurationFile = (String)storm_conf.get("java.security.auth.login.config");
        if ((loginConfigurationFile != null) && (loginConfigurationFile.length()>0)) {
            try {
                URI config_uri = new File(loginConfigurationFile).toURI();
                login_conf = Configuration.getInstance("JavaLoginConfig", new URIParameter(config_uri));
            } catch (NoSuchAlgorithmException ex1) {
                if (ex1.getCause() instanceof FileNotFoundException)
                    throw new RuntimeException("configuration file "+loginConfigurationFile+" could not be found");
                else throw new RuntimeException(ex1);
            } catch (Exception ex2) {
View Full Code Here

        //find login file configuration from Storm configuration 
        String loginConfigurationFile = (String)storm_conf.get("java.security.auth.login.config");
        if ((loginConfigurationFile != null) && (loginConfigurationFile.length()>0)) {
            try {
                URI config_uri = new File(loginConfigurationFile).toURI();
                login_conf = Configuration.getInstance("JavaLoginConfig", new URIParameter(config_uri));
            } catch (NoSuchAlgorithmException ex1) {
                if (ex1.getCause() instanceof FileNotFoundException)
                    throw new RuntimeException("configuration file "+loginConfigurationFile+" could not be found");
                else throw new RuntimeException(ex1);
            } catch (Exception ex2) {
View Full Code Here

    if ((loginConfigurationFile != null)
        && (loginConfigurationFile.length() > 0)) {
      try {
        URI config_uri = new File(loginConfigurationFile).toURI();
        login_conf = Configuration.getInstance("JavaLoginConfig",
            new URIParameter(config_uri));
      } catch (NoSuchAlgorithmException ex1) {
        if (ex1.getCause() instanceof FileNotFoundException)
          throw new RuntimeException("configuration file "
              + loginConfigurationFile + " could not be found");
        else
View Full Code Here

TOP

Related Classes of java.security.URIParameter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.