Package java.net

Examples of java.net.Authenticator


    @RunAsClient
    public void applyChangeSetTwice(@ArquillianResource URL baseURL) throws Exception {
        URL url = new URL(baseURL, "org.drools.guvnor.Guvnor/package/applyChangeSetTwice/LATEST/ChangeSet.xml");
        Resource res = ResourceFactory.newUrlResource(url);
        KnowledgeAgentConfiguration conf = KnowledgeAgentFactory.newKnowledgeAgentConfiguration();
        Authenticator.setDefault(new Authenticator() {
            @Override
            protected PasswordAuthentication getPasswordAuthentication() {
                return new PasswordAuthentication("admin", "admin".toCharArray());
            }
        });
View Full Code Here


    @Test
    @RunAsClient
    public void scanForChangeInRepository(@ArquillianResource URL baseURL) throws Exception {
        URL url = new URL(baseURL, "org.drools.guvnor.Guvnor/package/scanForChangeInRepository/LATEST/ChangeSet.xml");
        Resource res = ResourceFactory.newUrlResource(url);
        Authenticator.setDefault(new Authenticator() {
            @Override
            protected PasswordAuthentication getPasswordAuthentication() {
                return new PasswordAuthentication("admin", "admin".toCharArray());
            }
        });
View Full Code Here

    public void downloadPackageWithHttpClientImpl(@ArquillianResource URL baseURL)
            throws IOException, ClassNotFoundException {
        URL url = new URL(baseURL, "org.drools.guvnor.Guvnor/package/downloadPackageWithHttpClientImpl/snapshotC1");
        Resource resource = ResourceFactory.newUrlResource(url);
        KnowledgeAgentConfiguration conf = KnowledgeAgentFactory.newKnowledgeAgentConfiguration();
        Authenticator.setDefault(new Authenticator() {
            @Override
            protected PasswordAuthentication getPasswordAuthentication() {
                return new PasswordAuthentication("admin", "admin".toCharArray());
            }
        });
View Full Code Here

    public static final String USERNAME = "testSuite";
    public static final String PASSWORD = "testSuitePassword";


    public static Authenticator getAuthenticator() {
        return new Authenticator() {
            @Override
            protected PasswordAuthentication getPasswordAuthentication() {
                return new PasswordAuthentication(USERNAME, PASSWORD.toCharArray());
            }
        };
View Full Code Here

    private URL getHttpUrl() throws MalformedURLException
    {
        if ( username != null && password != null )
        {
            Authenticator.setDefault( new Authenticator()
            {
                protected PasswordAuthentication getPasswordAuthentication()
                {
                    PasswordAuthentication passwordAuthentication = new PasswordAuthentication( username, password.toCharArray() );
View Full Code Here

    private void connect(Map<String, String> sessionParameters) {
        this.sessionParameters = sessionParameters;

        // set a new dummy authenticator
        // don't send previous credentials to another server
        Authenticator.setDefault(new Authenticator() {
        });

        if (Boolean.parseBoolean(sessionParameters.get(ACCEPT_SELF_SIGNED_CERTIFICATES))) {
            acceptSelfSignedCertificates();
        }
View Full Code Here

                final String userName = proxy.getUsername();
                if ( !StringUtils.isEmpty( userName ) )
                {
                    final String pwd = StringUtils.isEmpty( proxy.getPassword() ) ? "" : proxy.getPassword();
                    Authenticator.setDefault( new Authenticator()
                    {
                        /** {@inheritDoc} */
                        protected PasswordAuthentication getPasswordAuthentication()
                        {
                            return new PasswordAuthentication( userName, pwd.toCharArray() );
View Full Code Here

    }

    public void login(Creditionals creditionals) throws Exception {
        final String userName = creditionals.getUserName();
        final String userPassword = creditionals.getPassword();
        Authenticator.setDefault(new Authenticator() {

            @Override
            protected PasswordAuthentication getPasswordAuthentication() {
                PasswordAuthentication pa = new PasswordAuthentication(userName, userPassword.toCharArray());
                return pa;
View Full Code Here

        this.p_user = Settings.getVal(AUTO_UPDATE_SETTING + PROXY_USER);
        this.p_pass = Settings.getVal(AUTO_UPDATE_SETTING + PROXY_PASS);
        this.now = System.currentTimeMillis();

        if (p_user != null && p_pass != null)
            Authenticator.setDefault(new Authenticator() {
                protected PasswordAuthentication getPasswordAuthentication() {
                    return new PasswordAuthentication
                        (p_user, p_pass.toCharArray());
                } });
    }
View Full Code Here

        this.p_user = Settings.getVal(AUTO_UPDATE_SETTING + PROXY_USER);
        this.p_pass = Settings.getVal(AUTO_UPDATE_SETTING + PROXY_PASS);
        this.now = System.currentTimeMillis();

        if (p_user != null && p_pass != null)
            Authenticator.setDefault(new Authenticator() {
                protected PasswordAuthentication getPasswordAuthentication() {
                    return new PasswordAuthentication
                        (p_user, p_pass.toCharArray());
                } });
    }
View Full Code Here

TOP

Related Classes of java.net.Authenticator

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.