Package com.mucommander.commons.file

Examples of com.mucommander.commons.file.Credentials


        // Insert the domain (if any) before the username, separated by a semicolon
        String userInfo = lastUsername;
        if(!lastDomain.equals(""))
            userInfo = lastDomain+";"+userInfo;

        url.setCredentials(new Credentials(userInfo, lastPassword));

        return url;
    }
View Full Code Here


            FileURL serverURL = currentServerPanel.getServerURL()// Can throw a MalformedURLException

            // Create a CredentialsMapping instance and pass to Folder so that it uses it to connect to the folder and
            // adds to CredentialsManager once the folder has been successfully changed
            Credentials credentials = serverURL.getCredentials();
            CredentialsMapping credentialsMapping;
            if(credentials!=null) {
                credentialsMapping = new CredentialsMapping(credentials, serverURL, saveCredentialsCheckBox.isSelected());
            }
            else {
View Full Code Here

            lastInitialDir = "/"+lastInitialDir;

        FileURL url = FileURL.getFileURL(FileProtocols.HDFS+"://"+lastServer+lastInitialDir);

        // Set user and group
        url.setCredentials(new Credentials(lastUsername, ""));
//        url.setProperty(HDFSFile.GROUP_PROPERTY_NAME, lastGroup);

        // Set port
        url.setPort(lastPort);
View Full Code Here

            lastInitialDir = "/"+lastInitialDir;

        FileURL url = FileURL.getFileURL(FileProtocols.SFTP+"://"+lastServer+lastInitialDir);

        // Set credentials
        url.setCredentials(new Credentials(lastUsername, lastPassword));
        if(!"".equals(lastKeyPath.trim()))
            url.setProperty(SFTPFile.PRIVATE_KEY_PATH_PROPERTY_NAME, lastKeyPath);

        // Set port
        url.setPort(lastPort);
View Full Code Here

        if(!(lastURL.toLowerCase().startsWith(FileProtocols.HTTP+"://") || lastURL.toLowerCase().startsWith(FileProtocols.HTTPS+"://")))
            lastURL = FileProtocols.HTTP+"://"+lastURL;

        FileURL fileURL = FileURL.getFileURL(lastURL);

        fileURL.setCredentials(new Credentials(lastUsername, lastPassword));

        return fileURL;
    }
View Full Code Here

            // Until early 0.8 beta3 nightly builds, credentials were stored directly in the bookmark's url.
            // Now bookmark locations are free of credentials, these are stored in a dedicated credentials file where
            // the password is encrypted.
            try {
                FileURL url = FileURL.getFileURL(characters.toString().trim());
                Credentials credentials = url.getCredentials();

                // If the URL contains credentials, import them into CredentialsManager and remove credentials
                // from the bookmark's location
                if(credentials!=null) {
                    CredentialsManager.addCredentials(new CredentialsMapping(credentials, url, true));
View Full Code Here

                ConnectionHandler connHandler = connections.get(i);

                // Show login (but not password) in the URL
                // Note: realm returned by ConnectionHandler does not contain credentials
                FileURL clonedRealm = (FileURL)connHandler.getRealm().clone();
                Credentials loginCredentials = new Credentials(connHandler.getCredentials().getLogin(), "");
                clonedRealm.setCredentials(loginCredentials);

                return clonedRealm.toString(true)
                        +" ("+Translator.get(connHandler.isLocked()?"server_connections_dialog.connection_busy":"server_connections_dialog.connection_idle")+")";
            }
View Full Code Here

            lastInitialDir = "/"+lastInitialDir;
     
        FileURL url = FileURL.getFileURL(FileProtocols.FTP+"://"+lastServer+lastInitialDir);

        if(anonymousUser)
            url.setCredentials(new Credentials(ANONYMOUS_CREDENTIALS.getLogin(), new String(passwordField.getPassword())));
        else
            url.setCredentials(new Credentials(lastUsername, lastPassword));

        // Set port
        url.setPort(lastPort);

        // Set passiveMode property to true (default) or false
View Full Code Here

  FileURL getServerURL() throws MalformedURLException {
    updateValues();
    FileURL url = FileURL.getFileURL(FileProtocols.VSPHERE + "://"
        + lastVsphere + "/" + lastGuest
        + "/" + PathUtils.removeLeadingSeparator(lastDir));
    url.setCredentials(new Credentials(lastUsername,  new String(passwordField.getPassword())));
    url.setProperty(VSphereFile.GUEST_CREDENTIALS, lastGuestUsername + ":" + new String(guestPasswordField.getPassword()));

    return url;
  }
View Full Code Here

            lastInitialDir = "/"+lastInitialDir;

        FileURL url = FileURL.getFileURL(FileProtocols.S3+"://"+lastServer+lastInitialDir);

        // Set credentials
        url.setCredentials(new Credentials(lastUsername, lastPassword));

        // Set port
        url.setPort(lastPort);

        return url;
View Full Code Here

TOP

Related Classes of com.mucommander.commons.file.Credentials

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.