本文整理汇总了Java中org.apache.ftpserver.usermanager.ClearTextPasswordEncryptor类的典型用法代码示例。如果您正苦于以下问题:Java ClearTextPasswordEncryptor类的具体用法?Java ClearTextPasswordEncryptor怎么用?Java ClearTextPasswordEncryptor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ClearTextPasswordEncryptor类属于org.apache.ftpserver.usermanager包,在下文中一共展示了ClearTextPasswordEncryptor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initFtpServer
import org.apache.ftpserver.usermanager.ClearTextPasswordEncryptor; //导入依赖的package包/类
protected void initFtpServer() throws Exception {
FtpServerFactory serverFactory = new FtpServerFactory();
// setup user management to read our users.properties and use clear text passwords
File file = new File("src/test/resources/users.properties");
UserManager uman = new PropertiesUserManager(new ClearTextPasswordEncryptor(), file, "admin");
serverFactory.setUserManager(uman);
NativeFileSystemFactory fsf = new NativeFileSystemFactory();
fsf.setCreateHome(true);
serverFactory.setFileSystem(fsf);
ListenerFactory factory = new ListenerFactory();
factory.setPort(ftpPort);
serverFactory.addListener("default", factory.createListener());
ftpServer = serverFactory.createServer();
}
示例2: initFtpServer
import org.apache.ftpserver.usermanager.ClearTextPasswordEncryptor; //导入依赖的package包/类
protected void initFtpServer() throws Exception {
FtpServerFactory serverFactory = new FtpServerFactory();
// setup user management to read our users.properties and use clear text passwords
File file = new File("src/test/resources/users.properties");
UserManager uman = new PropertiesUserManager(new ClearTextPasswordEncryptor(), file, "admin");
serverFactory.setUserManager(uman);
NativeFileSystemFactory fsf = new NativeFileSystemFactory();
fsf.setCreateHome(true);
serverFactory.setFileSystem(fsf);
ListenerFactory factory = new ListenerFactory();
factory.setPort(20128);
serverFactory.addListener("default", factory.createListener());
ftpServer = serverFactory.createServer();
}
示例3: createFtpServerFactory
import org.apache.ftpserver.usermanager.ClearTextPasswordEncryptor; //导入依赖的package包/类
protected FtpServerFactory createFtpServerFactory() throws Exception {
assertTrue(USERS_FILE.exists());
assertTrue("Port number is not initialized in an expected range: " + BaseServerTestSupport.port, BaseServerTestSupport.port >= 21000);
NativeFileSystemFactory fsf = new NativeFileSystemFactory();
fsf.setCreateHome(true);
PropertiesUserManagerFactory pumf = new PropertiesUserManagerFactory();
pumf.setAdminName("admin");
pumf.setPasswordEncryptor(new ClearTextPasswordEncryptor());
pumf.setFile(USERS_FILE);
UserManager userMgr = pumf.createUserManager();
ListenerFactory factory = new ListenerFactory();
factory.setPort(BaseServerTestSupport.port);
FtpServerFactory serverFactory = new FtpServerFactory();
serverFactory.setUserManager(userMgr);
serverFactory.setFileSystem(fsf);
serverFactory.setConnectionConfig(new ConnectionConfigFactory().createConnectionConfig());
serverFactory.addListener(DEFAULT_LISTENER, factory.createListener());
return serverFactory;
}
示例4: initFtpServer
import org.apache.ftpserver.usermanager.ClearTextPasswordEncryptor; //导入依赖的package包/类
public static void initFtpServer() throws Exception {
FtpServerFactory serverFactory = new FtpServerFactory();
// setup user management to read our users.properties and use clear text passwords
URL url = ObjectHelper.loadResourceAsURL("users.properties");
UserManager uman = new PropertiesUserManager(new ClearTextPasswordEncryptor(), url, "admin");
serverFactory.setUserManager(uman);
NativeFileSystemFactory fsf = new NativeFileSystemFactory();
fsf.setCreateHome(true);
serverFactory.setFileSystem(fsf);
ListenerFactory factory = new ListenerFactory();
factory.setPort(port);
serverFactory.addListener("default", factory.createListener());
ftpServer = serverFactory.createServer();
}
示例5: initFtpServer
import org.apache.ftpserver.usermanager.ClearTextPasswordEncryptor; //导入依赖的package包/类
public void initFtpServer() throws Exception {
FtpServerFactory serverFactory = new FtpServerFactory();
// setup user management to read our users.properties and use clear text passwords
URL url = ObjectHelper.loadResourceAsURL("users.properties");
UserManager uman = new PropertiesUserManager(new ClearTextPasswordEncryptor(), url, "admin");
serverFactory.setUserManager(uman);
NativeFileSystemFactory fsf = new NativeFileSystemFactory();
fsf.setCreateHome(true);
serverFactory.setFileSystem(fsf);
ListenerFactory factory = new ListenerFactory();
factory.setPort(port);
serverFactory.addListener("default", factory.createListener());
ftpServer = serverFactory.createServer();
}
示例6: createServer
import org.apache.ftpserver.usermanager.ClearTextPasswordEncryptor; //导入依赖的package包/类
private FtpServer createServer() {
FtpServerFactory serverFactory = new FtpServerFactory();
ListenerFactory listenerFactory = new ListenerFactory();
listenerFactory.setPort(FTP_PORT);
serverFactory.addListener("default", listenerFactory.createListener());
PropertiesUserManagerFactory managerFactory = new PropertiesUserManagerFactory();
managerFactory.setPasswordEncryptor(new ClearTextPasswordEncryptor());
managerFactory.setFile(new File("src/test/resources/users.properties"));
UserManager createUserManager = managerFactory.createUserManager();
serverFactory.setUserManager(createUserManager);
NativeFileSystemFactory fileSystemFactory = new NativeFileSystemFactory();
fileSystemFactory.setCreateHome(true);
serverFactory.setFileSystem(fileSystemFactory);
return serverFactory.createServer();
}
示例7: initFtpServer
import org.apache.ftpserver.usermanager.ClearTextPasswordEncryptor; //导入依赖的package包/类
public static void initFtpServer() throws Exception {
FtpServerFactory serverFactory = new FtpServerFactory();
// setup user management to read our users.properties and use clear text
// passwords
URL url = ObjectHelper.loadResourceAsURL("users.properties");
UserManager uman = new PropertiesUserManager(new ClearTextPasswordEncryptor(), url, "admin");
serverFactory.setUserManager(uman);
NativeFileSystemFactory fsf = new NativeFileSystemFactory();
fsf.setCreateHome(true);
serverFactory.setFileSystem(fsf);
ListenerFactory factory = new ListenerFactory();
factory.setPort(port);
serverFactory.addListener("default", factory.createListener());
ftpServer = serverFactory.createServer();
}
示例8: ftpUserManager
import org.apache.ftpserver.usermanager.ClearTextPasswordEncryptor; //导入依赖的package包/类
@Bean
public UserManager ftpUserManager() throws FtpException {
PropertiesUserManagerFactory userManagerFactory = new PropertiesUserManagerFactory();
userManagerFactory.setFile(new File("ftp-users.properties"));
userManagerFactory.setPasswordEncryptor(new ClearTextPasswordEncryptor());
return userManagerFactory.createUserManager();
}
示例9: createUserManagerFactory
import org.apache.ftpserver.usermanager.ClearTextPasswordEncryptor; //导入依赖的package包/类
@Override
protected UserManagerFactory createUserManagerFactory() throws FtpException {
PropertiesUserManagerFactory um = new PropertiesUserManagerFactory();
// set to null should make the user manager volatile, e.g. not use a file
um.setFile(null);
um.setPasswordEncryptor(new ClearTextPasswordEncryptor());
return um;
}
示例10: createUserManagerFactory
import org.apache.ftpserver.usermanager.ClearTextPasswordEncryptor; //导入依赖的package包/类
@Override
protected UserManagerFactory createUserManagerFactory() throws FtpException {
PropertiesUserManagerFactory um = new PropertiesUserManagerFactory();
um.setFile(USERS_FILE);
um.setPasswordEncryptor(new ClearTextPasswordEncryptor());
return um;
}
示例11: createUserManagerFactory
import org.apache.ftpserver.usermanager.ClearTextPasswordEncryptor; //导入依赖的package包/类
@Override
protected UserManagerFactory createUserManagerFactory() throws FtpException {
DbUserManagerFactory manager = (DbUserManagerFactory) super.createUserManagerFactory();
manager.setPasswordEncryptor(new ClearTextPasswordEncryptor());
return manager;
}
示例12: before
import org.apache.ftpserver.usermanager.ClearTextPasswordEncryptor; //导入依赖的package包/类
@BeforeClass
public static void before() throws Exception {
sshd = SshServer.setUpDefaultServer();
sshd.setPort(2220);
sshd.setKeyPairProvider(createTestKeyPairProvider("target/test-classes/quickstarts/camel-ftp-binding/hostkey.pem"));
sshd.setSubsystemFactories(Arrays.<NamedFactory<Command>>asList(new SftpSubsystem.Factory()));
sshd.setCommandFactory(new ScpCommandFactory());
sshd.setPasswordAuthenticator(new BogusPasswordAuthenticator());
//sshd.setFileSystemFactory(new org.apache.sshd.common.file.nativefs.NativeFileSystemFactory());
sshd.start();
FtpServerFactory serverFactory = new FtpServerFactory();
ListenerFactory listenerFactory = new ListenerFactory();
listenerFactory.setPort(2222);
serverFactory.addListener("default", listenerFactory.createListener());
ListenerFactory sslListenerFactory = new ListenerFactory();
sslListenerFactory.setPort(2221);
SslConfigurationFactory ssl = new SslConfigurationFactory();
ssl.setKeystoreFile(getFile("target/test-classes/quickstarts/camel-ftp-binding/ftpserver.jks"));
ssl.setKeystorePassword("password");
sslListenerFactory.setSslConfiguration(ssl.createSslConfiguration());
sslListenerFactory.setImplicitSsl(false); // Setting it to true will not read the file
serverFactory.addListener("ssl", sslListenerFactory.createListener());
PropertiesUserManagerFactory managerFactory = new PropertiesUserManagerFactory();
managerFactory.setPasswordEncryptor(new ClearTextPasswordEncryptor());
managerFactory.setFile(getFile("target/test-classes/quickstarts/camel-ftp-binding/ftp-users.properties"));
UserManager createUserManager = managerFactory.createUserManager();
serverFactory.setUserManager(createUserManager);
// This doesn't work due to class method signature mismatch
//NativeFileSystemFactory fileSystemFactory = new NativeFileSystemFactory();
//fileSystemFactory.setCreateHome(true);
//serverFactory.setFileSystem(fileSystemFactory);
File file = new File("target/ftp/ftps");
file.mkdirs();
file = new File("target/ftp/sftp");
file.mkdirs();
JSch sch = new JSch();
Session session = sch.getSession("camel", "localhost", 2220);
session.setUserInfo(new SimpleUserInfo("isMyFriend"));
session.connect();
ChannelSftp c = (ChannelSftp) session.openChannel("sftp");
c.connect();
System.out.println("Home: " + c.getHome());
c.chmod(777, ".");
c.chmod(777, "target");
c.chmod(777, "target/ftp");
c.chmod(777, "target/ftp/sftp");
c.disconnect();
session.disconnect();
ftpServer = serverFactory.createServer();
ftpServer.start();
startTestContainer(featureName, bundleName);
}
示例13: startUp
import org.apache.ftpserver.usermanager.ClearTextPasswordEncryptor; //导入依赖的package包/类
@BeforeClass
public static void startUp() throws Exception {
FtpServerFactory serverFactory = new FtpServerFactory();
ListenerFactory listenerFactory = new ListenerFactory();
listenerFactory.setPort(2222);
serverFactory.addListener("default", listenerFactory.createListener());
ListenerFactory sslListenerFactory = new ListenerFactory();
sslListenerFactory.setPort(2221);
SslConfigurationFactory ssl = new SslConfigurationFactory();
ssl.setKeystoreFile(new File("src/test/resources/ftpserver.jks"));
ssl.setKeystorePassword("password");
sslListenerFactory.setSslConfiguration(ssl.createSslConfiguration());
sslListenerFactory.setImplicitSsl(false); // Setting it to true will not read the file
serverFactory.addListener("ftps", sslListenerFactory.createListener());
PropertiesUserManagerFactory managerFactory = new PropertiesUserManagerFactory();
managerFactory.setPasswordEncryptor(new ClearTextPasswordEncryptor());
managerFactory.setFile(new File("src/test/resources/users.properties"));
UserManager createUserManager = managerFactory.createUserManager();
serverFactory.setUserManager(createUserManager);
NativeFileSystemFactory fileSystemFactory = new NativeFileSystemFactory();
fileSystemFactory.setCreateHome(true);
serverFactory.setFileSystem(fileSystemFactory);
File file = new File("target/ftp/ftps");
file.mkdirs();
file = new File("target/ftp/sftp");
file.mkdirs();
ftpServer = serverFactory.createServer();
ftpServer.start();
SshServer sshd = SshServer.setUpDefaultServer();
sshd.setPort(2220);
sshd.setKeyPairProvider(createTestKeyPairProvider("src/test/resources/hostkey.pem"));
sshd.setSubsystemFactories(Arrays.<NamedFactory<Command>>asList(new SftpSubsystem.Factory()));
sshd.setCommandFactory(new ScpCommandFactory());
sshd.setPasswordAuthenticator(new BogusPasswordAuthenticator());
sshd.start();
JSch sch = new JSch();
Session session = sch.getSession("camel", "localhost", 2220);
session.setUserInfo(new SimpleUserInfo("isMyFriend"));
session.connect();
ChannelSftp c = (ChannelSftp) session.openChannel("sftp");
c.connect();
System.out.println("Home: " + c.getHome());
c.chmod(777, ".");
c.chmod(777, "target");
c.chmod(777, "target/ftp");
c.chmod(777, "target/ftp/sftp");
c.disconnect();
session.disconnect();
}
示例14: InMemoryUserManager
import org.apache.ftpserver.usermanager.ClearTextPasswordEncryptor; //导入依赖的package包/类
public InMemoryUserManager() {
super("deep-dark-secret", new ClearTextPasswordEncryptor());
}
示例15: createUserManager
import org.apache.ftpserver.usermanager.ClearTextPasswordEncryptor; //导入依赖的package包/类
@Override
public UserManager createUserManager() {
return new FtpUserManager("admin", new ClearTextPasswordEncryptor());
}