Codota Logo
ProtocolFactory.forScheme
Code IndexAdd Codota to your IDE (free)

How to use
forScheme
method
in
ch.cyberduck.core.ProtocolFactory

Best Java code snippets using ch.cyberduck.core.ProtocolFactory.forScheme (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ArrayList a =
  • Codota Iconnew ArrayList<String>()
  • Codota Iconnew ArrayList()
  • Codota Iconnew ArrayList<Object>()
  • Smart code suggestions by Codota
}
origin: iterate-ch/cyberduck

/**
 * @param fullname Service name
 * @return Null if no protocol can be found for the given Rendezvous service type.
 * @see "http://developer.apple.com/qa/qa2001/qa1312.html"
 */
protected Protocol getProtocol(final String fullname) {
  if(fullname.contains(SERVICE_TYPE_SFTP)) {
    return protocols.forScheme(Scheme.sftp);
  }
  if(fullname.contains(SERVICE_TYPE_FTP)) {
    return protocols.forScheme(Scheme.ftp);
  }
  if(fullname.contains(SERVICE_TYPE_WEBDAV)) {
    return protocols.forScheme(Scheme.dav);
  }
  if(fullname.contains(SERVICE_TYPE_WEBDAV_TLS)) {
    return protocols.forScheme(Scheme.davs);
  }
  log.warn(String.format("Cannot find service type in %s", fullname));
  return null;
}
origin: iterate-ch/cyberduck

@Override
public void startElement(final String name, final Attributes attrs) {
  this.attrs = attrs;
  if(name.equals("Server")) {
    current = new Host(protocols.forScheme(Scheme.ftp));
  }
}
origin: iterate-ch/cyberduck

public Protocol forScheme(final Scheme scheme) {
  return this.forScheme(scheme.name(), null);
}
origin: iterate-ch/cyberduck

public Protocol forScheme(final String scheme, final Protocol fallback) {
  return this.forScheme(this.find(), scheme, fallback);
}
origin: iterate-ch/cyberduck

@Override
public void startElement(final String name, final Attributes attrs) {
  switch(name) {
    case "object":
      final String type = attrs.getValue("type");
      switch(type) {
        case "FAVORITE":
          current = new Host(protocols.forScheme(Scheme.ftp));
          break;
        default:
          log.warn(String.format("Unsupported type: %s", type));
          break;
      }
      break;
    case "attribute":
      attribute = attrs.getValue("name");
      break;
  }
}
origin: iterate-ch/cyberduck

/**
 * @param enabled    List of protocols
 * @param identifier Serialized protocol reference or scheme
 * @param provider   Custom inherited protocol definition
 * @return Matching protocol or null if no match
 */
public Protocol forName(final List<Protocol> enabled, final String identifier, final String provider) {
  final Protocol match =
    // Matching hash code backward compatibility
    enabled.stream().filter(protocol -> String.valueOf(protocol.hashCode()).equals(identifier)).findFirst().orElse(
      // Matching vendor string for third party profiles
      enabled.stream().filter(protocol -> new ProfileProtocolPredicate().test(protocol) && StringUtils.equals(protocol.getProvider(), provider)).findFirst().orElse(
        // Matching vendor string usage in CLI
        enabled.stream().filter(protocol -> StringUtils.equals(protocol.getProvider(), identifier)).findFirst().orElse(
          // Fallback for bug in 6.1
          enabled.stream().filter(protocol -> StringUtils.equals(String.format("%s-%s", protocol.getIdentifier(), protocol.getProvider()), identifier)).findFirst().orElse(
            // Matching scheme with fallback to generic protocol type
            this.forScheme(enabled, identifier, enabled.stream().filter(protocol -> StringUtils.equals(protocol.getType().name(), identifier)).findFirst().orElse(null))
          )
        )
      )
    );
  if(null == match) {
    if(enabled.isEmpty()) {
      log.error(String.format("List of registered protocols in %s is empty", this));
    }
    log.error(String.format("Missing registered protocol for identifier %s", identifier));
  }
  return match;
}
origin: iterate-ch/cyberduck

switch(name) {
  case "site":
    current = new Host(protocols.forScheme(Scheme.ftp), attrs.getValue("hName"));
    current.setNickname(attrs.getValue("name"));
    current.getCredentials().setUsername(attrs.getValue("un"));
      switch(Integer.valueOf(protocol)) {
        case 1:
          current.setProtocol(protocols.forScheme(Scheme.ftp));
          break;
        case 2:
        case 3:
        case 4:
          current.setProtocol(protocols.forScheme(Scheme.ftps));
          break;
        case 6:
          current.setProtocol(protocols.forScheme(Scheme.dav));
          break;
        case 7:
          current.setProtocol(protocols.forScheme(Scheme.davs));
          break;
        case 8:
        case 9:
          current.setProtocol(protocols.forScheme(Scheme.s3));
          break;
origin: iterate-ch/cyberduck

switch(Integer.parseInt(value)) {
  case 4:
    current.setProtocol(protocols.forScheme(Scheme.sftp));
    break;
  case 5:
    current.setProtocol(protocols.forScheme(Scheme.ftps));
    break;
origin: iterate-ch/cyberduck

@Override
public void startElement(String name, Attributes attrs) {
  if(name.equals("FavoriteItem")) {
    current = new Host(protocols.forScheme(Scheme.ftp));
    current.getCredentials().setUsername(
        PreferencesFactory.get().getProperty("connection.login.anon.name"));
  }
}
origin: iterate-ch/cyberduck

if(line.startsWith("[")) {
  this.add(current);
  current = new Host(protocols.forScheme(Scheme.ftp));
  current.getCredentials().setUsername(
      PreferencesFactory.get().getProperty("connection.login.anon.name"));
origin: iterate-ch/cyberduck

while((line = in.readLine()) != null) {
  if(line.startsWith("[account_")) {
    current = new Host(protocols.forScheme(Scheme.s3));
origin: iterate-ch/cyberduck

switch(protocolstring) {
  case "FTP":
    protocol = protocols.forScheme(Scheme.ftp);
    break;
  case "SFTP":
    protocol = protocols.forScheme(Scheme.sftp);
    break;
  case "FTPTLS":
  case "FTPSSL":
    protocol = protocols.forScheme(Scheme.ftps);
    break;
  case "S3":
    protocol = protocols.forScheme(Scheme.s3);
    break;
  case "WebDAV":
    protocol = protocols.forScheme(Scheme.dav);
    break;
  case "WebDAVS":
    protocol = protocols.forScheme(Scheme.davs);
    break;
  default:
origin: iterate-ch/cyberduck

  this.add(current);
current = new Host(protocols.forScheme(Scheme.ftp));
current.getCredentials().setUsername(
    PreferencesFactory.get().getProperty("connection.login.anon.name"));
origin: iterate-ch/cyberduck

while((line = in.readLine()) != null) {
  if(line.startsWith("[")) {
    current = new Host(protocols.forScheme(Scheme.ftp));
    current.getCredentials().setUsername(
        PreferencesFactory.get().getProperty("connection.login.anon.name"));
origin: iterate-ch/cyberduck

switch(StringUtils.lowerCase(elementText)) {
  case "webdav":
    current.setProtocol(protocols.forScheme(Scheme.dav));
    break;
  case "webdavs":
    current.setProtocol(protocols.forScheme(Scheme.davs));
    break;
  case "sftp":
    current.setProtocol(protocols.forScheme(Scheme.sftp));
    break;
  case "ftptls":
  case "ftpssl":
    current.setProtocol(protocols.forScheme(Scheme.ftps));
    break;
  case "ftp":
    current.setProtocol(protocols.forScheme(Scheme.ftp));
    break;
  case "s3":
    current.setProtocol(protocols.forScheme(Scheme.s3));
    break;
origin: iterate-ch/cyberduck

  return false;
final Host host = new Host(protocols.forScheme(Scheme.ftp), server);
final String port = bookmark.stringForKey("Port");
if(StringUtils.isNotBlank(port)) {
    switch(Integer.parseInt(protocol)) {
      case 0:
        host.setProtocol(protocols.forScheme(Scheme.ftp));
        break;
      case 1:
        host.setProtocol(protocols.forScheme(Scheme.sftp));
        break;
      case 3:
        host.setProtocol(protocols.forScheme(Scheme.s3));
        break;
      case 2:
      case 4:
        if(host.getPort() == Scheme.davs.getPort()) {
          host.setProtocol(protocols.forScheme(Scheme.davs));
          host.setProtocol(protocols.forScheme(Scheme.dav));
origin: iterate-ch/cyberduck

switch(protocol.getType()) {
  case ftp:
    protocol = protocols.forScheme(Scheme.ftps);
    break;
  case dav:
    protocol = protocols.forScheme(Scheme.davs);
    break;
origin: iterate-ch/cyberduck

host.setProtocol(ProtocolFactory.get().forScheme(Scheme.davs));
return false;
origin: iterate-ch/cyberduck

  MessageFormat.format(LocaleFactory.localizedString("Unsecured {0} connection", "Credentials"), host.getProtocol().getName()),
  MessageFormat.format("{0} {1}.", MessageFormat.format(LocaleFactory.localizedString("The server supports encrypted connections. Do you want to switch to {0}?", "Credentials"),
    ProtocolFactory.get().forScheme(Scheme.ftps).getName()), LocaleFactory.localizedString("Please contact your web hosting service provider for assistance", "Support")),
  LocaleFactory.localizedString("Continue", "Credentials"),
  LocaleFactory.localizedString("Change", "Credentials"),
host.setProtocol(ProtocolFactory.get().forScheme(Scheme.ftps));
origin: iterate-ch/cyberduck

while(reader.hasNext()) {
  reader.beginObject();
  final Host current = new Host(protocols.forScheme(Scheme.ftp));
  boolean skip = false;
  while(reader.hasNext()) {
ch.cyberduck.coreProtocolFactoryforScheme

Popular methods of ProtocolFactory

  • get
  • forName
  • find
  • register
  • forType
  • loadDefaultProfiles
    Load profiles embedded in bundles and installed in the application support directory.

Popular in Java

  • Updating database using SQL prepared statement
  • onRequestPermissionsResult (Fragment)
  • getExternalFilesDir (Context)
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now