Package org.apache.ftpserver.ftplet

Examples of org.apache.ftpserver.ftplet.Configuration


    }

    protected FtpServer createFtpServer() throws Exception {
        // get the configuration object
        Properties properties = createFtpServerProperties();
        Configuration config = new PropertiesConfiguration(properties);

        // create servce context
        FtpServerContext ftpConfig = new ConfigurableFtpServerContext(config);

        // create the server object and start it
View Full Code Here


 
  public void start() throws EmbeddableException
  {
    try
    {
      Configuration configuration = new PropertiesConfiguration( ftpProperties );
      FtpServerContext context = new ConfigurableFtpServerContext( configuration );
      server = new FtpServer( context );
      server.start();
    }
    catch (IOException e)
View Full Code Here

    }

    protected FtpServer createFtpServer() throws Exception {
        // get the configuration object
        Properties properties = createFtpServerProperties();
        Configuration config = new PropertiesConfiguration(properties);

        // create service context
        FtpServerContext ftpConfig = new ConfigurableFtpServerContext(config);

        // create the server object and start it
View Full Code Here

    }
   
    private Map<String, Bean> createListeners(Configuration conf, String prefix) throws Exception {
        Map<String, Bean> map = new HashMap<String, Bean>();

        Configuration listenersConfig = conf.subset(prefix);
        if(listenersConfig.isEmpty()) {
            // create default listener
            Bean listenerBean = createComponent(listenersConfig, "default", NioListener.class.getName());
           
            map.put("default", listenerBean);
        } else {
       
            Iterator<String> keys = listenersConfig.getKeys();
           
            while (keys.hasNext()) {
                String key = (String) keys.next();
               
                Bean listenerBean = createComponent(listenersConfig, key, NioListener.class.getName());
View Full Code Here

     * @param conf
     * @throws FtpException
     */
    private void initFtplets(FtpletContainer container, Configuration conf) throws FtpException {
        String ftpletNames = conf.getString("ftplets", null);
        Configuration ftpletConf = conf.subset("ftplet");
               
        if(ftpletNames == null) {
            return;
        }
       
        //log = ftpConfig.getLogFactory().getInstance(getClass());
        StringTokenizer st = new StringTokenizer(ftpletNames, " ,;\r\n\t");
        try {
            while(st.hasMoreTokens()) {
                String ftpletName = st.nextToken();
                LOG.info("Configuring ftplet : " + ftpletName);
               
                // get ftplet specific configuration
                Configuration subConfig = ftpletConf.subset(ftpletName);
               
                Ftplet ftplet = (Ftplet) ConfigurationClassUtils.createBean(subConfig, DefaultFtplet.class.getName());
                ftplet.init(this);
                container.addFtplet(ftpletName, ftplet);
            }
View Full Code Here

     * Create component.
     */
    private Bean createComponent(Configuration parentConfig, String configName, String defaultClass) throws Exception {
       
        // get configuration subset
        Configuration conf = parentConfig.subset(configName);
       
        Bean bean = Bean.createBean(conf, defaultClass);
        bean.initBean();
        return bean;
    }
View Full Code Here

   
    public static void main(String[] args) throws Exception {
        try{
            if(server == null) {
                // get configuration
                Configuration config = getConfiguration(args);
                if(config == null) {
                    LOG.error("No configuration provided");
                    throw new FtpException("No configuration provided");
                }
   
View Full Code Here

    /**
     * Get the configuration object.
     */
    private static Configuration getConfiguration(String[] args) throws Exception {
   
        Configuration config = null;
        FileInputStream in = null;
        try {
            if(args == null || args.length < 2) {
                LOG.info("Using default configuration....");
                config = EmptyConfiguration.INSTANCE;
View Full Code Here

                Iterator<String> mapKeys = getKeysInOrder(config.getKeys());
               
                while (mapKeys.hasNext()) {
                    String mapKey = mapKeys.next();
                    String mapValue = config.getString(mapKey, null);
                    Configuration mapConfig = config.subset(mapKey);
                   
                    map.put(mapKey, createObject(String.class, mapConfig, mapValue));
                }
               
                value = map;
View Full Code Here

            if(key.equals("class")) {
                continue;
            }
           
            Configuration subConfig = config.subset(key);
           
            String propValue = config.getString(key, null);
           
            PropertyDescriptor descriptor = getDescriptor(clazz, key);
           
View Full Code Here

TOP

Related Classes of org.apache.ftpserver.ftplet.Configuration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.