Cyberduck Mountain Duck CLI

Changeset 41269


Ignore:
Timestamp:
Jun 7, 2017 9:00:18 PM (13 months ago)
Author:
dkocher
Message:

Find protocol by scheme.

Location:
shelves/02.06.2017
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • shelves/02.06.2017/bonjour/src/main/java/ch/cyberduck/core/bonjour/AbstractRendezvous.java

    r36048 r41269  
    2525import ch.cyberduck.core.PathNormalizer;
    2626import ch.cyberduck.core.Protocol;
     27import ch.cyberduck.core.ProtocolFactory;
     28import ch.cyberduck.core.Scheme;
    2729import ch.cyberduck.core.UserDateFormatterFactory;
    28 import ch.cyberduck.core.dav.DAVProtocol;
    29 import ch.cyberduck.core.dav.DAVSSLProtocol;
    30 import ch.cyberduck.core.ftp.FTPProtocol;
    31 import ch.cyberduck.core.sftp.SFTPProtocol;
    3230
    3331import org.apache.commons.lang3.StringUtils;
     
    182180    protected Protocol getProtocol(final String fullname) {
    183181        if(fullname.contains(SERVICE_TYPE_SFTP)) {
    184             return new SFTPProtocol();
     182            return ProtocolFactory.forScheme(Scheme.sftp);
    185183        }
    186184        if(fullname.contains(SERVICE_TYPE_FTP)) {
    187             return new FTPProtocol();
     185            return ProtocolFactory.forScheme(Scheme.ftp);
    188186        }
    189187        if(fullname.contains(SERVICE_TYPE_WEBDAV)) {
    190             return new DAVProtocol();
     188            return ProtocolFactory.forName("dav");
    191189        }
    192190        if(fullname.contains(SERVICE_TYPE_WEBDAV_TLS)) {
    193             return new DAVSSLProtocol();
     191            return ProtocolFactory.forName("davs");
    194192        }
    195193        log.warn(String.format("Cannot find service type in %s", fullname));
  • shelves/02.06.2017/core/src/main/java/ch/cyberduck/core/proxy/ProxyHostUrlProvider.java

    r35652 r41269  
    3333        switch(host.getProtocol().getScheme()) {
    3434            case sftp:
    35                 return super.get(new Host(ProtocolFactory.forScheme(Scheme.ftp.name()), host.getHostname(), host.getPort()));
     35                return super.get(new Host(ProtocolFactory.forScheme(Scheme.ftp), host.getHostname(), host.getPort()));
    3636        }
    3737        return super.get(host);
  • shelves/02.06.2017/ftp/src/main/java/ch/cyberduck/core/ftp/FTPSession.java

    r40930 r41269  
    2828import ch.cyberduck.core.LoginCallback;
    2929import ch.cyberduck.core.Path;
     30import ch.cyberduck.core.ProtocolFactory;
     31import ch.cyberduck.core.Scheme;
    3032import ch.cyberduck.core.cdn.DistributionConfiguration;
    3133import ch.cyberduck.core.cloudfront.CustomOriginCloudFrontDistributionConfiguration;
     
    238240                                MessageFormat.format(LocaleFactory.localizedString("Unsecured {0} connection", "Credentials"), host.getProtocol().getName()),
    239241                                MessageFormat.format("{0} {1}.", MessageFormat.format(LocaleFactory.localizedString("The server supports encrypted connections. Do you want to switch to {0}?", "Credentials"),
    240                                         new FTPTLSProtocol().getName()), LocaleFactory.localizedString("Please contact your web hosting service provider for assistance", "Support")),
     242                                        ProtocolFactory.forScheme(Scheme.ftps).getName()), LocaleFactory.localizedString("Please contact your web hosting service provider for assistance", "Support")),
    241243                                LocaleFactory.localizedString("Continue", "Credentials"),
    242244                                LocaleFactory.localizedString("Change", "Credentials"),
     
    246248                    catch(LoginCanceledException e) {
    247249                        // Protocol switch
    248                         host.setProtocol(new FTPTLSProtocol());
     250                        host.setProtocol(ProtocolFactory.forScheme(Scheme.ftps));
    249251                        // Reconfigure client for TLS
    250252                        this.configure(client);
Note: See TracChangeset for help on using the changeset viewer.
swiss made software