本文整理汇总了Java中org.apache.ftpserver.usermanager.ClearTextPasswordEncryptor类的典型用法代码示例。如果您正苦于以下问题:Java ClearTextPasswordEncryptor类的具体用法?Java ClearTextPasswordEncryptor怎么用?Java ClearTextPasswordEncryptor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ClearTextPasswordEncryptor类属于org.apache.ftpserver.usermanager包,在下文中一共展示了ClearTextPasswordEncryptor类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: startFtpServer
import org.apache.ftpserver.usermanager.ClearTextPasswordEncryptor; //导入依赖的package包/类
@Before
public void startFtpServer() throws Exception {
recursiveDelete(resolvePath(FTP_ROOT_DIR).toFile());
File usersFile = USERS_FILE.toFile();
usersFile.createNewFile();
NativeFileSystemFactory fsf = new NativeFileSystemFactory();
fsf.setCreateHome(true);
PropertiesUserManagerFactory pumf = new PropertiesUserManagerFactory();
pumf.setAdminName("admin");
pumf.setPasswordEncryptor(new ClearTextPasswordEncryptor());
pumf.setFile(usersFile);
UserManager userMgr = pumf.createUserManager();
BaseUser user = new BaseUser();
user.setName("admin");
user.setPassword("admin");
user.setHomeDirectory(FTP_ROOT_DIR.toString());
List<Authority> authorities = new ArrayList<>();
WritePermission writePermission = new WritePermission();
writePermission.authorize(new WriteRequest());
authorities.add(writePermission);
user.setAuthorities(authorities);
userMgr.save(user);
ListenerFactory factory1 = new ListenerFactory();
factory1.setPort(PORT);
FtpServerFactory serverFactory = new FtpServerFactory();
serverFactory.setUserManager(userMgr);
serverFactory.setFileSystem(fsf);
serverFactory.setConnectionConfig(new ConnectionConfigFactory().createConnectionConfig());
serverFactory.addListener("default", factory1.createListener());
FtpServerFactory factory = serverFactory;
ftpServer = factory.createServer();
ftpServer.start();
}
开发者ID:wildfly-extras,项目名称:wildfly-camel,代码行数:43,代码来源:FtpIntegrationTest.java
示例17: doParse
import org.apache.ftpserver.usermanager.ClearTextPasswordEncryptor; //导入依赖的package包/类
@Override
protected void doParse(final Element element,
final ParserContext parserContext,
final BeanDefinitionBuilder builder) {
Class<?> factoryClass;
if (element.getLocalName().equals("file-user-manager")) {
factoryClass = PropertiesUserManagerFactory.class;
} else {
factoryClass = DbUserManagerFactory.class;
}
BeanDefinitionBuilder factoryBuilder = BeanDefinitionBuilder.genericBeanDefinition(factoryClass);
// common for both user managers
if (StringUtils.hasText(element.getAttribute("encrypt-passwords"))) {
String encryptionStrategy = element.getAttribute("encrypt-passwords");
if(encryptionStrategy.equals("true") || encryptionStrategy.equals("md5")) {
factoryBuilder.addPropertyValue("passwordEncryptor", new Md5PasswordEncryptor());
} else if(encryptionStrategy.equals("salted")) {
factoryBuilder.addPropertyValue("passwordEncryptor", new SaltedPasswordEncryptor());
} else {
factoryBuilder.addPropertyValue("passwordEncryptor", new ClearTextPasswordEncryptor());
}
}
if (factoryClass == PropertiesUserManagerFactory.class) {
if (StringUtils.hasText(element.getAttribute("file"))) {
factoryBuilder.addPropertyValue("file", element.getAttribute("file"));
}
if (StringUtils.hasText(element.getAttribute("url"))) {
factoryBuilder.addPropertyValue("url", element.getAttribute("url"));
}
} else {
Element dsElm = SpringUtil.getChildElement(element,
FtpServerNamespaceHandler.FTPSERVER_NS, "data-source");
// schema ensure we get the right type of element
Element springElm = SpringUtil.getChildElement(dsElm, null, null);
Object o;
if ("bean".equals(springElm.getLocalName())) {
o = parserContext.getDelegate().parseBeanDefinitionElement(
springElm, builder.getBeanDefinition());
} else {
// ref
o = parserContext.getDelegate().parsePropertySubElement(
springElm, builder.getBeanDefinition());
}
factoryBuilder.addPropertyValue("dataSource", o);
factoryBuilder.addPropertyValue("sqlUserInsert", getSql(element,
"insert-user"));
factoryBuilder.addPropertyValue("sqlUserUpdate", getSql(element,
"update-user"));
factoryBuilder.addPropertyValue("sqlUserDelete", getSql(element,
"delete-user"));
factoryBuilder.addPropertyValue("sqlUserSelect", getSql(element,
"select-user"));
factoryBuilder.addPropertyValue("sqlUserSelectAll", getSql(element,
"select-all-users"));
factoryBuilder.addPropertyValue("sqlUserAdmin",
getSql(element, "is-admin"));
factoryBuilder.addPropertyValue("sqlUserAuthenticate", getSql(element,
"authenticate"));
}
BeanDefinition factoryDefinition = factoryBuilder.getBeanDefinition();
String factoryId = parserContext.getReaderContext().generateBeanName(factoryDefinition);
BeanDefinitionHolder factoryHolder = new BeanDefinitionHolder(factoryDefinition, factoryId);
registerBeanDefinition(factoryHolder, parserContext.getRegistry());
// set the factory on the listener bean
builder.getRawBeanDefinition().setFactoryBeanName(factoryId);
builder.getRawBeanDefinition().setFactoryMethodName("createUserManager");
}
开发者ID:saaconsltd,项目名称:mina-ftpserver,代码行数:81,代码来源:UserManagerBeanDefinitionParser.java
示例18: createPasswordEncryptor
import org.apache.ftpserver.usermanager.ClearTextPasswordEncryptor; //导入依赖的package包/类
protected PasswordEncryptor createPasswordEncryptor() {
return new ClearTextPasswordEncryptor();
}
开发者ID:saaconsltd,项目名称:mina-ftpserver,代码行数:4,代码来源:ClearTextPasswordEncryptorTest.java
示例19: testNonePasswordEncryptor
import org.apache.ftpserver.usermanager.ClearTextPasswordEncryptor; //导入依赖的package包/类
public void testNonePasswordEncryptor() throws Throwable {
PropertiesUserManager um = createPropertiesUserManager("<file-user-manager file=\"" + USER_FILE_PATH + "\" encrypt-passwords=\"clear\" />");
assertTrue(um.getPasswordEncryptor() instanceof ClearTextPasswordEncryptor);
}
开发者ID:saaconsltd,项目名称:mina-ftpserver,代码行数:6,代码来源:FileUserManagerConfigTest.java
示例20: testFalsePasswordEncryptor
import org.apache.ftpserver.usermanager.ClearTextPasswordEncryptor; //导入依赖的package包/类
public void testFalsePasswordEncryptor() throws Throwable {
PropertiesUserManager um = createPropertiesUserManager("<file-user-manager file=\"" + USER_FILE_PATH + "\" encrypt-passwords=\"false\" />");
assertTrue(um.getPasswordEncryptor() instanceof ClearTextPasswordEncryptor);
}
开发者ID:saaconsltd,项目名称:mina-ftpserver,代码行数:6,代码来源:FileUserManagerConfigTest.java
注:本文中的org.apache.ftpserver.usermanager.ClearTextPasswordEncryptor类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论