Exemple #1
0
        public override void addPassword(String protocol, int port, String hostName, String user, String password)
        {
            Host host = new Host(ProtocolFactory.forScheme(protocol), hostName, port);

            host.getCredentials().setUsername(user);
            Preferences.instance().setProperty(host.toURL(), DataProtector.Encrypt(password));
        }
        public override void addPassword(Scheme scheme, int port, String hostName, String user, String password)
        {
            Host host = new Host(ProtocolFactory.forScheme(scheme.name()), hostName, port);

            host.getCredentials().setUsername(user);
            PreferencesFactory.get().setProperty(new HostUrlProvider().get(host), DataProtector.Encrypt(password));
        }
Exemple #3
0
        public override string getPassword(String protocol, int port, String hostName, String user)
        {
            Host host = new Host(ProtocolFactory.forScheme(protocol), hostName, port);

            host.getCredentials().setUsername(user);
            return(getPassword(host));
        }
        public override string getPassword(String hostName, String user)
        {
            Host host = new Host(ProtocolFactory.forScheme(Scheme.ftp.name()), hostName);

            host.getCredentials().setUsername(user);
            return(getPassword(host));
        }