congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
ProtocolFactory
Code IndexAdd Tabnine to your IDE (free)

How to use
ProtocolFactory
in
ch.cyberduck.core

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

origin: iterate-ch/cyberduck

public TransferPlistReader(final DeserializerFactory deserializer) {
  this(ProtocolFactory.get(), deserializer);
}
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

/**
 * Parses URL in the format ftp://username:pass@hostname:portnumber/path/to/file
 *
 * @param url URL
 * @return Bookmark
 */
public static Host parse(final String url) {
  final Host parsed = parse(ProtocolFactory.get(), ProtocolFactory.get().forName(
    preferences.getProperty("connection.protocol.default")), url);
  if(log.isDebugEnabled()) {
    log.debug(String.format("Parsed %s as %s", url, parsed));
  }
  return parsed;
}
origin: iterate-ch/cyberduck

/**
 * @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 String identifier, final String provider) {
  return this.forName(this.find(), identifier, provider);
}
origin: iterate-ch/cyberduck

public Protocol forType(final Protocol.Type type) {
  final List<Protocol> enabled = this.find();
  return this.forType(enabled, type);
}
origin: iterate-ch/cyberduck

public Protocol forScheme(final String scheme, final Protocol fallback) {
  return this.forScheme(this.find(), scheme, fallback);
}
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

this.protocolCombobox.setAction(Foundation.selector("protocolComboboxClicked:"));
this.protocolCombobox.removeAllItems();
final ProtocolFactory protocols = ProtocolFactory.get();
for(Protocol protocol : protocols.find(new DefaultProtocolPredicate(
  EnumSet.of(Protocol.Type.ftp, Protocol.Type.sftp, Protocol.Type.dav)))) {
  this.addProtocol(protocol);
for(Protocol protocol : protocols.find(new DefaultProtocolPredicate(
  EnumSet.of(Protocol.Type.s3, Protocol.Type.swift, Protocol.Type.azure, Protocol.Type.b2, Protocol.Type.dracoon, Protocol.Type.googlestorage)))) {
  this.addProtocol(protocol);
for(Protocol protocol : protocols.find(new DefaultProtocolPredicate(
  EnumSet.of(Protocol.Type.dropbox, Protocol.Type.onedrive, Protocol.Type.googledrive)))) {
  this.addProtocol(protocol);
for(Protocol protocol : protocols.find(new DefaultProtocolPredicate(
  EnumSet.of(Protocol.Type.file)))) {
  this.addProtocol(protocol);
for(Protocol protocol : protocols.find(new ProfileProtocolPredicate())) {
  this.addProtocol(protocol);
  = ProtocolFactory.get().forName(preferences.getProperty("connection.protocol.default"));
this.protocolCombobox.selectItemAtIndex(this.protocolCombobox.indexOfItemWithRepresentedObject(String.valueOf(defaultProtocol.hashCode())));
origin: iterate-ch/cyberduck

final ProtocolFactory protocols = ProtocolFactory.get();
protocols.register(
    new FTPProtocol(),
    new FTPTLSProtocol(),
  log.info(String.format("Using default encoding %s", System.getProperty("file.encoding")));
protocols.loadDefaultProfiles();
final MainController c = new MainController();
origin: iterate-ch/cyberduck

  .append(StringUtils.LF);
final ProtocolFactory protocols = ProtocolFactory.get();
for(Protocol p : protocols.find(new DefaultProtocolPredicate(EnumSet.of(Protocol.Type.ftp, Protocol.Type.sftp, Protocol.Type.dav)))) {
  append(p, builder);
for(Protocol p : protocols.find(new DefaultProtocolPredicate(EnumSet.of(Protocol.Type.s3, Protocol.Type.swift, Protocol.Type.azure, Protocol.Type.b2, Protocol.Type.googlestorage)))) {
  append(p, builder);
for(Protocol p : protocols.find(new DefaultProtocolPredicate(
  EnumSet.of(Protocol.Type.dropbox, Protocol.Type.onedrive, Protocol.Type.googledrive, Protocol.Type.dracoon)))) {
  append(p, builder);
for(Protocol p : protocols.find(new DefaultProtocolPredicate(EnumSet.of(Protocol.Type.file)))) {
  append(p, builder);
    PreferencesFactory.get().getProperty("profiles.folder.name")).getAbbreviatedPath()));
builder.append(StringUtils.LF);
for(Protocol p : protocols.find(new ProfileProtocolPredicate())) {
  append(p, builder);
origin: iterate-ch/cyberduck

  switch(type) {
    case "google_cloud_storage":
      protocol = protocols.forType(Protocol.Type.googlestorage);
      break;
    case "gdrive":
      protocol = protocols.forType(Protocol.Type.googledrive);
      break;
    default:
      protocol = protocols.forName(type);
switch(protocol.getType()) {
  case ftp:
    protocol = protocols.forScheme(Scheme.ftps);
    break;
  case dav:
    protocol = protocols.forScheme(Scheme.davs);
    break;
origin: iterate-ch/cyberduck

  log.debug(String.format("Register profile %s", profile));
ProtocolFactory.get().register(profile);
final Host host = new Host(profile, profile.getDefaultHostname(), profile.getDefaultPort());
newDocument().addBookmark(host);
origin: iterate-ch/cyberduck

while(reader.hasNext()) {
  reader.beginObject();
  final Host current = new Host(protocols.forScheme(Scheme.ftp));
  boolean skip = false;
  while(reader.hasNext()) {
        break;
      case "type":
        final Protocol type = protocols.forName(this.readNext(name, reader));
        if(null != type) {
          current.setProtocol(type);
        final Protocol protocol = protocols.forName(this.readNext(name, reader));
        if(null != protocol) {
          current.setProtocol(protocol);
origin: iterate-ch/cyberduck

/**
 * @param identifier Serialized protocol reference or scheme
 * @return Matching protocol or null if no match
 */
public Protocol forName(final String identifier) {
  return this.forName(identifier, null);
}
origin: iterate-ch/cyberduck

    log.debug(String.format("Register profile %s", profile));
  protocols.register(profile);
  protocols.loadDefaultProfiles();
protocols.loadDefaultProfiles();
origin: iterate-ch/cyberduck

public void register(Protocol... protocols) {
  // Order determines list in connection dropdown
  for(Protocol protocol : protocols) {
    this.register(protocol);
  }
}
origin: iterate-ch/cyberduck

/**
 * @return List of enabled protocols
 */
public List<Protocol> find() {
  return this.find(Protocol::isEnabled);
}
origin: iterate-ch/cyberduck

@Override
public void startElement(String name, Attributes attrs) {
  switch(name) {
    case "Settings":
      String type = attrs.getValue("xsi:type");
      switch(type) {
        case "GoogleSettings":
          current = new Host(protocols.forType(Protocol.Type.googlestorage));
          break;
        case "S3Settings":
        case "DunkelSettings":
          current = new Host(protocols.forType(Protocol.Type.s3));
          break;
        default:
          log.warn("Unsupported connection type:" + type);
          break;
      }
      break;
  }
}
origin: iterate-ch/cyberduck

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

  public Profile deserialize(Object serialized) {
    final Deserializer<String> dict = deserializer.create(serialized);
    final String protocol = dict.stringForKey("Protocol");
    if(StringUtils.isNotBlank(protocol)) {
      final Protocol parent = protocols.forName(protocols.find(new Predicate<Protocol>() {
        @Override
        public boolean test(final Protocol protocol) {
          // Return default registered protocol specification as parent but not other profile
          return !(protocol.isEnabled() || protocol.isBundled());
        }
      }), protocol, null);
      if(null == parent) {
        log.error(String.format("Unknown protocol %s in profile", protocol));
        return null;
      }
      return new Profile(parent, dict);
    }
    log.error("Missing protocol in profile");
    return null;
  }
}
ch.cyberduck.coreProtocolFactory

Most used methods

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

Popular in Java

  • Parsing JSON documents to java classes using gson
  • scheduleAtFixedRate (Timer)
  • compareTo (BigDecimal)
  • requestLocationUpdates (LocationManager)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • JPanel (javax.swing)
  • Table (org.hibernate.mapping)
    A relational table
  • Top 12 Jupyter Notebook Extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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