@Action public void pathInputDidChange(final NSNotification sender) { bookmark.setDefaultPath(pathField.stringValue()); this.update(); }
current.setDefaultPath(value); break; case "comment":
break; case "directory": current.setDefaultPath(value); break; case "username":
protected void add(final String fullname, final String hostname, final int port, final String user, final String password, final String path) { final Protocol protocol = this.getProtocol(fullname); if(null == protocol) { log.warn(String.format("Unknown service type for %s", fullname)); return; } final Host host = new Host(protocol, hostname, port); host.getCredentials().setUsername(user); host.getCredentials().setPassword(password); if(StringUtils.isNotBlank(path)) { host.setDefaultPath(PathNormalizer.normalize(path)); } host.setComment(UserDateFormatterFactory.get().getLongFormat(new Date().getTime())); this.add(fullname, host); }
public Host parse(final String uri) { final Host host = new HostParser(factory).get(uri); if(input.hasOption(TerminalOptionsBuilder.Params.region.name())) { host.setRegion(input.getOptionValue(TerminalOptionsBuilder.Params.region.name())); } final Path directory = new CommandLinePathParser(input, factory).parse(uri); if(directory.isDirectory()) { host.setDefaultPath(directory.getAbsolute()); } else { host.setDefaultPath(directory.getParent().getAbsolute()); } if(input.hasOption(TerminalOptionsBuilder.Params.udt.name())) { host.setTransfer(Host.TransferType.udt); } if(log.isDebugEnabled()) { log.debug(String.format("Parsed %s as %s", uri, host)); } return host; } }
current.setDefaultPath(value); break; case "notes":
current.setWebURL(attrs.getValue("wURL")); current.setComment(attrs.getValue("comm")); current.setDefaultPath(attrs.getValue("path")); String protocol = attrs.getValue("ftpPType"); try {
current.setDefaultPath(b.toString());
break; case "Path": current.setDefaultPath(elementText); break; case "HTTP": break; case "WebRootPath": current.setDefaultPath(elementText); break; case "PrivateKey":
current.setDefaultPath(value); break; case "webhost":
bookmark.setDefaultPath(path);
public Credentials get() throws BackgroundException { final Host address = new HostParser(factory).get(url); final Path access = new Path(PathNormalizer.normalize(address.getDefaultPath()), EnumSet.of(Path.Type.file)); address.setDefaultPath(String.valueOf(Path.DELIMITER)); final DAVSession connection = new DAVSession(address, trust, key); connection.withListener(transcript).open(ProxyFactory.get().find(address), new DisabledHostKeyCallback(), new DisabledLoginCallback()); final InputStream in = new DAVReadFeature(connection).read(access, new TransferStatus(), new DisabledConnectionCallback()); try { final Credentials credentials = this.parse(in); connection.close(); return credentials; } finally { connection.removeListener(transcript); } }
host.setDefaultPath(path);
current.setDefaultPath(this.readNext(name, reader)); break; case "type":
@Override public void callback(final int returncode) { switch(returncode) { case DEFAULT_OPTION: final Host host = HostParser.parse(urlField.stringValue()); final Path file = new Path(PathNormalizer.normalize(host.getDefaultPath()), EnumSet.of(detector.detect(host.getDefaultPath()))); host.setDefaultPath(file.getParent().getAbsolute()); final Transfer transfer = new DownloadTransfer(host, file, LocalFactory.get(PreferencesFactory.get().getProperty("queue.download.folder"), file.getName())); TransferControllerFactory.get().start(transfer, new TransferOptions()); break; } }
/** * Open a new browser with the current selected folder as the working directory * * @param sender Toolbar button */ @Action public void newBrowserButtonClicked(final ID sender) { Path selected = this.getSelectedPath(); if(null == selected || !selected.isDirectory()) { selected = this.workdir(); } BrowserController c = MainController.newDocument(true); final Host host = new HostDictionary().deserialize(pool.getHost().serialize(SerializerFactory.get())); host.setDefaultPath(selected.getAbsolute()); c.mount(host); }
bookmark.setDefaultPath(selected.getDefaultPath());
@Action public void addBookmarkButtonClicked(final ID sender) { final Host bookmark; if(this.isMounted()) { Path selected = this.getSelectedPath(); if(null == selected || !selected.isDirectory()) { selected = this.workdir(); } bookmark = new HostDictionary().deserialize(pool.getHost().serialize(SerializerFactory.get())); // Make sure a new UUID is asssigned for duplicate bookmark.setUuid(null); bookmark.setDefaultPath(selected.getAbsolute()); } else { bookmark = new Host(ProtocolFactory.get().forName(preferences.getProperty("connection.protocol.default"))); } this.selectBookmarks(BookmarkSwitchSegement.bookmarks); this.addBookmark(bookmark); }
break; case "initialremotepath": current.setDefaultPath(elementText); break;
@Action public void hostFieldDidChange(final NSNotification sender) { final String input = hostField.stringValue(); if(Scheme.isURL(input)) { final Host parsed = HostParser.parse(input); bookmark.setHostname(parsed.getHostname()); bookmark.setProtocol(parsed.getProtocol()); bookmark.setPort(parsed.getPort()); bookmark.setDefaultPath(parsed.getDefaultPath()); } else { bookmark.setHostname(input); final Credentials auto = CredentialsConfiguratorFactory.get(bookmark.getProtocol()).configure(bookmark); final Credentials credentials = bookmark.getCredentials(); credentials.setUsername(auto.getUsername()); credentials.setPassword(auto.getPassword()); credentials.setIdentity(auto.getIdentity()); credentials.setToken(auto.getToken()); credentials.setCertificate(auto.getCertificate()); } this.update(); }