Search in sources :

Example 11 with FileURL

use of com.mucommander.commons.file.FileURL in project mucommander by mucommander.

the class SMBPanel method getServerURL.

// //////////////////////////////
// ServerPanel implementation //
// //////////////////////////////
@Override
public FileURL getServerURL() throws MalformedURLException {
    updateValues();
    FileURL url = FileURL.getFileURL(FileProtocols.SMB + "://" + lastServer + (lastShare.startsWith("/") ? "" : "/") + lastShare);
    // 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;
}
Also used : FileURL(com.mucommander.commons.file.FileURL) Credentials(com.mucommander.commons.file.Credentials)

Example 12 with FileURL

use of com.mucommander.commons.file.FileURL in project mucommander by mucommander.

the class NFSPanel method getServerURL.

// //////////////////////////////
// ServerPanel implementation //
// //////////////////////////////
@Override
public FileURL getServerURL() throws MalformedURLException {
    updateValues();
    FileURL url = FileURL.getFileURL(FileProtocols.NFS + "://" + lastServer + (lastShare.startsWith("/") ? "" : "/") + lastShare);
    // Set port
    url.setPort(lastPort);
    // Set NFS version
    url.setProperty(NFSFile.NFS_VERSION_PROPERTY_NAME, lastNfsVersion);
    // Set NFS protocol
    url.setProperty(NFSFile.NFS_PROTOCOL_PROPERTY_NAME, lastNfsProtocol);
    return url;
}
Also used : FileURL(com.mucommander.commons.file.FileURL)

Example 13 with FileURL

use of com.mucommander.commons.file.FileURL in project mucommander by mucommander.

the class RegistryPanel method getServerURL.

@Override
public FileURL getServerURL() throws MalformedURLException {
    FileURL url = FileURL.getFileURL(String.format("%s://%s/%s", typeComboBox.getSelectedItem(), serverField.getText(), imageField.getText()));
    url.setCredentials(new Credentials(usernameField.getText(), new String(passwordField.getPassword())));
    return url;
}
Also used : FileURL(com.mucommander.commons.file.FileURL) Credentials(com.mucommander.commons.file.Credentials)

Example 14 with FileURL

use of com.mucommander.commons.file.FileURL in project mucommander by mucommander.

the class OvirtPanel method getServerURL.

@Override
public FileURL getServerURL() throws MalformedURLException {
    FileURL url = FileURL.getFileURL(String.format("ovirt://%s:%s/", serverField.getText(), lastPort = (int) portSpinner.getValue()));
    url.setCredentials(new Credentials(usernameField.getText(), new String(passwordField.getPassword())));
    url.setProperty("proxy", Boolean.toString(useProxy));
    return url;
}
Also used : FileURL(com.mucommander.commons.file.FileURL) Credentials(com.mucommander.commons.file.Credentials)

Example 15 with FileURL

use of com.mucommander.commons.file.FileURL in project mucommander by mucommander.

the class HDFSPanel method getServerURL.

// //////////////////////////////
// ServerPanel implementation //
// //////////////////////////////
@Override
public FileURL getServerURL() throws MalformedURLException {
    updateValues();
    if (!lastInitialDir.startsWith("/"))
        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);
    return url;
}
Also used : FileURL(com.mucommander.commons.file.FileURL) Credentials(com.mucommander.commons.file.Credentials)

Aggregations

FileURL (com.mucommander.commons.file.FileURL)60 AbstractFile (com.mucommander.commons.file.AbstractFile)18 Credentials (com.mucommander.commons.file.Credentials)16 IOException (java.io.IOException)11 AuthException (com.mucommander.commons.file.AuthException)7 MalformedURLException (java.net.MalformedURLException)5 CredentialsMapping (com.mucommander.auth.CredentialsMapping)3 UnsupportedFileOperationException (com.mucommander.commons.file.UnsupportedFileOperationException)3 ProtocolFile (com.mucommander.commons.file.protocol.ProtocolFile)3 File (java.io.File)3 SftpException (com.jcraft.jsch.SftpException)2 AuthDialog (com.mucommander.ui.dialog.auth.AuthDialog)2 RandomAccessFile (java.io.RandomAccessFile)2 ArrayList (java.util.ArrayList)2 Date (java.util.Date)2 HashMap (java.util.HashMap)2 DbxException (com.dropbox.core.DbxException)1 DbxRequestConfig (com.dropbox.core.DbxRequestConfig)1 JsonReader (com.dropbox.core.json.JsonReader)1 DbxCredential (com.dropbox.core.oauth.DbxCredential)1