当前位置: 首页>>代码示例>>Java>>正文


Java ClearTextPasswordEncryptor类代码示例

本文整理汇总了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();
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:19,代码来源:FtpAndHttpRecipientListInterceptSendToEndpointIssueTest.java

示例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();
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:19,代码来源:FtpCronScheduledRoutePolicyTest.java

示例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;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:25,代码来源:FtpServerTestSupport.java

示例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();
}
 
开发者ID:camelinaction,项目名称:camelinaction2,代码行数:20,代码来源:FtpServerBean.java

示例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();
}
 
开发者ID:camelinaction,项目名称:camelinaction2,代码行数:20,代码来源:FtpServerBean.java

示例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();
}
 
开发者ID:tadayosi,项目名称:samples-switchyard,代码行数:18,代码来源:FTPServer.java

示例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();
}
 
开发者ID:xuzhikethinker,项目名称:t4f-data,代码行数:21,代码来源:FtpServerBean.java

示例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();
   }
 
开发者ID:PoJD,项目名称:hawa,代码行数:8,代码来源:SecurityConfig.java

示例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;
}
 
开发者ID:saaconsltd,项目名称:mina-ftpserver,代码行数:11,代码来源:VolatilePropertiesUserManagerTest.java

示例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;
}
 
开发者ID:saaconsltd,项目名称:mina-ftpserver,代码行数:9,代码来源:PropertiesUserManagerTest.java

示例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;

}
 
开发者ID:saaconsltd,项目名称:mina-ftpserver,代码行数:8,代码来源:ClearTextDbUserManagerTest.java

示例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);
}
 
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:62,代码来源:CamelFTPBindingQuickstartTest.java

示例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();
}
 
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:58,代码来源:CamelFtpBindingTest.java

示例14: InMemoryUserManager

import org.apache.ftpserver.usermanager.ClearTextPasswordEncryptor; //导入依赖的package包/类
public InMemoryUserManager() {
    super("deep-dark-secret", new ClearTextPasswordEncryptor());
}
 
开发者ID:signed,项目名称:in-memory-infrastructure,代码行数:4,代码来源:InMemoryUserManager.java

示例15: createUserManager

import org.apache.ftpserver.usermanager.ClearTextPasswordEncryptor; //导入依赖的package包/类
@Override
public UserManager createUserManager() {
	return new FtpUserManager("admin", new ClearTextPasswordEncryptor());
}
 
开发者ID:andresoviedo,项目名称:google-drive-ftp-adapter,代码行数:5,代码来源:GFtpServerFactory.java


注:本文中的org.apache.ftpserver.usermanager.ClearTextPasswordEncryptor类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。