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;
}
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;
}
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;
}
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;
}
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;
}
Aggregations