Search in sources :

Example 46 with FileURL

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

the class Utils method getChildUrl.

public static FileURL getChildUrl(OvirtFile parent, Identified child) {
    FileURL parentUrl = parent.getURL();
    String parentPath = PathUtils.removeTrailingSeparator(parentUrl.getPath()) + AbstractFile.DEFAULT_SEPARATOR;
    FileURL url = (FileURL) parentUrl.clone();
    url.setPath(parentPath + child.name());
    return url;
}
Also used : FileURL(com.mucommander.commons.file.FileURL)

Example 47 with FileURL

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

the class Utils method getChildUrl.

public static FileURL getChildUrl(OvirtFile parent, Disk disk) {
    FileURL url = getChildUrl(parent, (Identified) disk);
    url.setProperty("id", disk.id());
    return url;
}
Also used : FileURL(com.mucommander.commons.file.FileURL)

Example 48 with FileURL

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

the class RegistryImage method toFile.

private AbstractFile toFile(String layer) {
    String parentPath = PathUtils.removeTrailingSeparator(fileURL.getPath()) + AbstractFile.DEFAULT_SEPARATOR;
    FileURL childURL = (FileURL) fileURL.clone();
    childURL.setPath(parentPath + layer.split(":")[1]);
    childURL.setScheme("file");
    GzipArchiveFile archive = new GzipArchiveFile(FileFactory.getFile(childURL));
    archive.setCustomExtension("tar.gz");
    archive.setParent(this);
    return archive;
}
Also used : GzipArchiveFile(com.mucommander.commons.file.archive.gzip.GzipArchiveFile) FileURL(com.mucommander.commons.file.FileURL)

Example 49 with FileURL

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

the class VSpherePanel method getServerURL.

// //////////////////////////////
// ServerPanel implementation //
// //////////////////////////////
@Override
public 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;
}
Also used : FileURL(com.mucommander.commons.file.FileURL) Credentials(com.mucommander.commons.file.Credentials)

Example 50 with FileURL

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

the class HTTPPanel method getServerURL.

// //////////////////////////////
// ServerPanel implementation //
// //////////////////////////////
@Override
public FileURL getServerURL() throws MalformedURLException {
    updateValues();
    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;
}
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