• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java DataConnectionConfigurationFactory类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.ftpserver.DataConnectionConfigurationFactory的典型用法代码示例。如果您正苦于以下问题:Java DataConnectionConfigurationFactory类的具体用法?Java DataConnectionConfigurationFactory怎么用?Java DataConnectionConfigurationFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DataConnectionConfigurationFactory类属于org.apache.ftpserver包,在下文中一共展示了DataConnectionConfigurationFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: createServer

import org.apache.ftpserver.DataConnectionConfigurationFactory; //导入依赖的package包/类
public static FtpServer createServer(int port, int maxLoginFailures, int loginFailureDelay,
                                     boolean anonymousEnable, String anonymousHomeDirectory,
                                     FTPUser... users) {
    final ListenerFactory listener = new ListenerFactory();
    listener.setPort(port);
    listener.setDataConnectionConfiguration(
            new DataConnectionConfigurationFactory().createDataConnectionConfiguration());

    ConnectionConfigFactory connection = new ConnectionConfigFactory();
    connection.setMaxLoginFailures(maxLoginFailures);
    connection.setLoginFailureDelay(loginFailureDelay);
    connection.setAnonymousLoginEnabled(anonymousEnable);

    final FtpServerFactory server = new FtpServerFactory();
    server.setUserManager(new FTPUserManager(anonymousEnable, anonymousHomeDirectory, users));
    server.setFileSystem(FTPFileSystemFactory.getInstance());
    server.addListener("default", listener.createListener());
    server.setConnectionConfig(connection.createConnectionConfig());

    return server.createServer();
}
 
开发者ID:AlexMofer,项目名称:ProjectX,代码行数:22,代码来源:FTPHelper.java


示例2: configureSSL

import org.apache.ftpserver.DataConnectionConfigurationFactory; //导入依赖的package包/类
private ListenerFactory configureSSL() {
    ListenerFactory listener = new ListenerFactory();
    listener.setServerAddress("127.0.0.1");
    listener.setPort(PORT);

    SslConfigurationFactory ssl = new SslConfigurationFactory();
    ssl.setKeystoreFile(SERVER_SSL_KEY_TRUST_STORE);
    ssl.setKeyPassword(SERVER_SSL_KEY_PASSWD);
    ssl.setKeystorePassword(SERVER_SSL_STORE_PASSWD);
    ssl.setTruststoreFile(SERVER_SSL_KEY_TRUST_STORE);
    ssl.setTruststorePassword(SERVER_SSL_STORE_PASSWD);
    ssl.setClientAuthentication("NEED");

    SslConfiguration sslConfig = ssl.createSslConfiguration();

    listener.setSslConfiguration(sslConfig);
    listener.setImplicitSsl(true);
    DataConnectionConfigurationFactory dataConfigFactory = new DataConnectionConfigurationFactory();
    dataConfigFactory.setImplicitSsl(true);

    listener.setDataConnectionConfiguration(dataConfigFactory.createDataConnectionConfiguration());

    return listener;
}
 
开发者ID:jboss-integration,项目名称:fuse-bxms-integ,代码行数:25,代码来源:CamelFtpsTest.java


示例3: createServer

import org.apache.ftpserver.DataConnectionConfigurationFactory; //导入依赖的package包/类
@Override
protected FtpServerFactory createServer() throws Exception {
    FtpServerFactory server = super.createServer();

    ListenerFactory listenerFactory = new ListenerFactory(server.getListener("default"));
    
    DataConnectionConfigurationFactory dccFactory = new DataConnectionConfigurationFactory();

    dccFactory.setPassiveExternalAddress("127.0.0.1");

    listenerFactory.setDataConnectionConfiguration(dccFactory.createDataConnectionConfiguration());

    server.addListener("default", listenerFactory.createListener());
    CommandFactoryFactory cmFact = new CommandFactoryFactory();
    cmFact.setUseDefaultCommands(true);
    cmFact.addCommand("PASV", new PASVTest());
    server.setCommandFactory(cmFact.createCommandFactory());
    return server;
}
 
开发者ID:saaconsltd,项目名称:mina-ftpserver,代码行数:20,代码来源:PasvAddressWithOverridenHostnameGetter.java


示例4: createServer

import org.apache.ftpserver.DataConnectionConfigurationFactory; //导入依赖的package包/类
@Override
protected FtpServerFactory createServer() throws Exception {
    FtpServerFactory server = super.createServer();

    ListenerFactory listenerFactory = new ListenerFactory(server.getListener("default"));
    
    DataConnectionConfigurationFactory dccFactory = new DataConnectionConfigurationFactory();
    
    passiveAddress = TestUtil.findNonLocalhostIp().getHostAddress();
    dccFactory.setPassiveAddress(passiveAddress);
    dccFactory.setPassivePorts("12347");
    DataConnectionConfiguration dcc=dccFactory.createDataConnectionConfiguration();
    
    listenerFactory.setDataConnectionConfiguration(dcc);
    
    server.addListener("default", listenerFactory.createListener());
    return server;
}
 
开发者ID:saaconsltd,项目名称:mina-ftpserver,代码行数:19,代码来源:PasvAddressTest.java


示例5: createDataConnectionConfigurationFactory

import org.apache.ftpserver.DataConnectionConfigurationFactory; //导入依赖的package包/类
@Override
protected DataConnectionConfigurationFactory createDataConnectionConfigurationFactory() {
    DataConnectionConfigurationFactory result = super
            .createDataConnectionConfigurationFactory();
    result.setImplicitSsl(true);
    return result;
}
 
开发者ID:saaconsltd,项目名称:mina-ftpserver,代码行数:8,代码来源:MinaImplicitDataChannelTest.java


示例6: createDataConnectionConfigurationFactory

import org.apache.ftpserver.DataConnectionConfigurationFactory; //导入依赖的package包/类
@Override
protected DataConnectionConfigurationFactory createDataConnectionConfigurationFactory() {
    DataConnectionConfigurationFactory factory = super.createDataConnectionConfigurationFactory();
    factory.setActiveLocalPort(2020);
    factory.setActiveLocalAddress("localhost");
    return factory;
}
 
开发者ID:saaconsltd,项目名称:mina-ftpserver,代码行数:8,代码来源:BindExceptionSerialTest.java


示例7: getDataConnectionConfigurationFactory

import org.apache.ftpserver.DataConnectionConfigurationFactory; //导入依赖的package包/类
public DataConnectionConfigurationFactory getDataConnectionConfigurationFactory() {
	return dataConnectionConfigurationFactory;
}
 
开发者ID:geosolutions-it,项目名称:OpenSDI-Manager2,代码行数:4,代码来源:FtpServerStarter.java


示例8: setDataConnectionConfigurationFactory

import org.apache.ftpserver.DataConnectionConfigurationFactory; //导入依赖的package包/类
public void setDataConnectionConfigurationFactory(
		DataConnectionConfigurationFactory dataConnectionConfigurationFactory) {
	this.dataConnectionConfigurationFactory = dataConnectionConfigurationFactory;
}
 
开发者ID:geosolutions-it,项目名称:OpenSDI-Manager2,代码行数:5,代码来源:FtpServerStarter.java


示例9: ftpServerFactory

import org.apache.ftpserver.DataConnectionConfigurationFactory; //导入依赖的package包/类
public static FtpServer ftpServerFactory(String name, HashMap<String, ConfigurationItem> all_instances_confs, HashMap<String, Ftplet> ftplets) throws Exception {
	FtpServerFactory server_factory = new FtpServerFactory();
	
	LinkedHashMap<String, Object> log = new LinkedHashMap<String, Object>();
	
	DataConnectionConfigurationFactory dccf = new DataConnectionConfigurationFactory();
	dccf.setActiveEnabled(true);
	dccf.setActiveIpCheck(true);
	log.put("active", dccf.isActiveEnabled());
	log.put("active IP check", dccf.isActiveIpCheck());
	
	ConfigurationClusterItem local = Configuration.getClusterConfiguration(all_instances_confs, name, "active", "0.0.0.0", 20).get(0);
	dccf.setActiveLocalAddress(local.address);
	dccf.setActiveLocalPort(local.port);
	log.put("active local", dccf.getActiveLocalAddress() + ":" + dccf.getActiveLocalPort());
	
	int idle = Configuration.getValue(all_instances_confs, name, "idle", 300);
	dccf.setIdleTime(idle);
	log.put("Idle time", dccf.getIdleTime());
	
	dccf.setImplicitSsl(false);
	dccf.setPassiveAddress(Configuration.getValue(all_instances_confs, name, "passive-internal", "0.0.0.0"));
	dccf.setPassiveExternalAddress(Configuration.getValue(all_instances_confs, name, "passive-external", "0.0.0.0"));
	dccf.setPassivePorts(Configuration.getValue(all_instances_confs, name, "passive-ports", "30000-40000"));
	log.put("passive", dccf.getPassiveAddress() + ">" + dccf.getPassiveExternalAddress());
	log.put("passive ports", dccf.getPassivePorts());
	
	ListenerFactory factory = new ListenerFactory();
	factory.setPort(Configuration.getValue(all_instances_confs, name, "listen", 21));
	factory.setIpFilter(FTPIpFilter.getFilter());
	factory.setIdleTimeout(idle);
	log.put("port", factory.getPort());
	
	factory.setDataConnectionConfiguration(dccf.createDataConnectionConfiguration());
	
	server_factory.addListener("default", factory.createListener());
	
	FTPUserManager ftpum;
	if (name == "default") {
		ftpum = new FTPUserManager("");
	} else {
		ftpum = new FTPUserManager(name);
		server_factory.setUserManager(ftpum);
	}
	server_factory.setUserManager(ftpum);
	log.put("User Manager", ftpum);
	
	server_factory.setFtplets(ftplets);
	
	Loggers.FTPserver.info("Start FTP Server: " + log);
	
	FtpServer server = server_factory.createServer();
	server.start();
	return server;
}
 
开发者ID:hdsdi3g,项目名称:MyDMAM,代码行数:56,代码来源:FTPOperations.java


示例10: parseDataConnection

import org.apache.ftpserver.DataConnectionConfigurationFactory; //导入依赖的package包/类
private DataConnectionConfiguration parseDataConnection(
        final Element element,
        final SslConfiguration listenerSslConfiguration) {
    DataConnectionConfigurationFactory dc = new DataConnectionConfigurationFactory();

    if (element != null) {
        
        dc.setImplicitSsl(SpringUtil.parseBoolean(element, "implicit-ssl", false));
        
        // data con config element available
        SslConfiguration ssl = parseSsl(element);

        if (ssl != null) {
            LOG.debug("SSL configuration found for the data connection");
            dc.setSslConfiguration(ssl);
        }

        dc.setIdleTime(SpringUtil.parseInt(element, "idle-timeout", dc.getIdleTime()));

        Element activeElm = SpringUtil.getChildElement(element,
                FtpServerNamespaceHandler.FTPSERVER_NS, "active");
        if (activeElm != null) {
            dc.setActiveEnabled(SpringUtil.parseBoolean(activeElm, "enabled",
                    true));
            dc.setActiveIpCheck(SpringUtil.parseBoolean(activeElm,
                    "ip-check", false));
            dc.setActiveLocalPort(SpringUtil.parseInt(activeElm,
                    "local-port", 0));
            
            String localAddress = SpringUtil.parseStringFromInetAddress(
                    activeElm, "local-address");
            if (localAddress != null) {
            	dc.setActiveLocalAddress(localAddress);
            }
        }

        Element passiveElm = SpringUtil.getChildElement(element,
                FtpServerNamespaceHandler.FTPSERVER_NS, "passive");
        if (passiveElm != null) {
            String address = SpringUtil.parseStringFromInetAddress(passiveElm,
                    "address");
            if (address != null) {
            	dc.setPassiveAddress(address);
            }

            String externalAddress = SpringUtil.parseStringFromInetAddress(
                    passiveElm, "external-address");
            if (externalAddress != null) {
                dc.setPassiveExternalAddress(externalAddress);
            }

            String ports = SpringUtil.parseString(passiveElm, "ports");
            if (ports != null) {
                dc.setPassivePorts(ports);
            }
            dc.setPassiveIpCheck(SpringUtil.parseBoolean(passiveElm,
                "ip-check", false));
        }
    } else {
        // no data conn config element, do we still have SSL config from the
        // parent?
        if (listenerSslConfiguration != null) {
            LOG
                    .debug("SSL configuration found for the listener, falling back for that for the data connection");
            dc.setSslConfiguration(listenerSslConfiguration);
        }
    }

    return dc.createDataConnectionConfiguration();
}
 
开发者ID:saaconsltd,项目名称:mina-ftpserver,代码行数:71,代码来源:ListenerBeanDefinitionParser.java


示例11: createServer

import org.apache.ftpserver.DataConnectionConfigurationFactory; //导入依赖的package包/类
@Override
protected FtpServerFactory createServer() throws Exception {
    FtpServerFactory server = super.createServer();

    ListenerFactory listenerFactory = new ListenerFactory(server.getListener("default"));
    
    DataConnectionConfigurationFactory dccFactory = new DataConnectionConfigurationFactory();

    dccFactory.setPassiveExternalAddress("127.0.0.1");

    listenerFactory.setDataConnectionConfiguration(dccFactory.createDataConnectionConfiguration());

    server.addListener("default", listenerFactory.createListener());

    return server;
}
 
开发者ID:saaconsltd,项目名称:mina-ftpserver,代码行数:17,代码来源:PasvAddressWithHostnameTest.java


示例12: createServer

import org.apache.ftpserver.DataConnectionConfigurationFactory; //导入依赖的package包/类
@Override
protected FtpServerFactory createServer() throws Exception {
    FtpServerFactory server = super.createServer();

    ListenerFactory listenerFactory = new ListenerFactory(server
            .getListener("default"));

    DataConnectionConfigurationFactory dccFactory = new DataConnectionConfigurationFactory();

    passivePort = TestUtil.findFreePort(12444);

    dccFactory.setPassivePorts(passivePort + "-" + (passivePort + 1));

    listenerFactory.setDataConnectionConfiguration(dccFactory
            .createDataConnectionConfiguration());

    server.addListener("default", listenerFactory.createListener());

    return server;
}
 
开发者ID:saaconsltd,项目名称:mina-ftpserver,代码行数:21,代码来源:PasvUsedPortTest.java


示例13: createServer

import org.apache.ftpserver.DataConnectionConfigurationFactory; //导入依赖的package包/类
@Override
protected FtpServerFactory createServer() throws Exception {
    FtpServerFactory server = super.createServer();
    
    ListenerFactory listenerFactory = new ListenerFactory(server.getListener("default"));
    
    DataConnectionConfigurationFactory dccFactory = new DataConnectionConfigurationFactory();

    int passivePort = TestUtil.findFreePort(12000 + new Random().nextInt(20000));
    
    dccFactory.setPassivePorts(passivePort + "-" + passivePort);
    
    listenerFactory.setDataConnectionConfiguration(dccFactory.createDataConnectionConfiguration());

    server.addListener("default", listenerFactory.createListener());
    
    return server;
}
 
开发者ID:saaconsltd,项目名称:mina-ftpserver,代码行数:19,代码来源:PasvTest.java


示例14: createServer

import org.apache.ftpserver.DataConnectionConfigurationFactory; //导入依赖的package包/类
@Override
protected FtpServerFactory createServer() throws Exception {
    FtpServerFactory server = super.createServer();

    ListenerFactory listenerFactory = new ListenerFactory(server
            .getListener("default"));

    DataConnectionConfigurationFactory dccFactory = new DataConnectionConfigurationFactory();

    passivePort = TestUtil.findFreePort(12444);

    dccFactory.setPassivePorts(String.valueOf(passivePort));

    listenerFactory.setDataConnectionConfiguration(dccFactory
            .createDataConnectionConfiguration());

    server.addListener("default", listenerFactory.createListener());

    return server;
}
 
开发者ID:saaconsltd,项目名称:mina-ftpserver,代码行数:21,代码来源:PasvPortUnavailableTest.java


示例15: createDataConnectionConfigurationFactory

import org.apache.ftpserver.DataConnectionConfigurationFactory; //导入依赖的package包/类
protected DataConnectionConfigurationFactory createDataConnectionConfigurationFactory() {
    return new DataConnectionConfigurationFactory();
}
 
开发者ID:saaconsltd,项目名称:mina-ftpserver,代码行数:4,代码来源:ClientTestTemplate.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java RongContext类代码示例发布时间:2022-05-22
下一篇:
Java Query类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap