Tabnine Logo
ProtocolFactory.forScheme
Code IndexAdd Tabnine 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)

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

  • Finding current android device location
  • compareTo (BigDecimal)
  • scheduleAtFixedRate (Timer)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • JPanel (javax.swing)
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now