Package org.apache.ftpserver

Examples of org.apache.ftpserver.FtpServerConfigurationException


                MessageResource mr = parseMessageResource(childElm,
                        parserContext, builder);
                factoryBuilder.addPropertyValue("messageResource", mr);

            } else {
                throw new FtpServerConfigurationException(
                        "Unknown configuration name: " + childName);
            }
        }

        // Configure login limits
View Full Code Here


                        listenerElm, builder.getBeanDefinition());
            } else if ("listener".equals(ln)) {
                listener = SpringUtil.parseSpringChildElement(listenerElm,
                        parserContext, builder);
            } else {
                throw new FtpServerConfigurationException(
                        "Unknown listener element " + ln);
            }

            String name = listenerElm.getAttribute("name");
View Full Code Here

                    springElm, builder.getBeanDefinition());
        } else if ("ref".equals(ln)) {
            return parserContext.getDelegate().parsePropertySubElement(
                    springElm, builder.getBeanDefinition());
        } else {
            throw new FtpServerConfigurationException("Unknown spring element "
                    + ln);
        }
    }
View Full Code Here

            final String attrName) {
        if (StringUtils.hasText(parent.getAttribute(attrName))) {
            try {
                return InetAddress.getByName(parent.getAttribute(attrName));
            } catch (UnknownHostException e) {
                throw new FtpServerConfigurationException("Unknown host", e);
            }
        }
        return null;
    }
View Full Code Here

    private PasswordEncryptor passwordEncryptor = new Md5PasswordEncryptor();
   
    public UserManager createUserManager() {
        if (dataSource == null) {
            throw new FtpServerConfigurationException(
                    "Required data source not provided");
        }
        if (insertUserStmt == null) {
            throw new FtpServerConfigurationException(
                    "Required insert user SQL statement not provided");
        }
        if (updateUserStmt == null) {
            throw new FtpServerConfigurationException(
                    "Required update user SQL statement not provided");
        }
        if (deleteUserStmt == null) {
            throw new FtpServerConfigurationException(
                    "Required delete user SQL statement not provided");
        }
        if (selectUserStmt == null) {
            throw new FtpServerConfigurationException(
                    "Required select user SQL statement not provided");
        }
        if (selectAllStmt == null) {
            throw new FtpServerConfigurationException(
                    "Required select all users SQL statement not provided");
        }
        if (isAdminStmt == null) {
            throw new FtpServerConfigurationException(
                    "Required is admin user SQL statement not provided");
        }
        if (authenticateStmt == null) {
            throw new FtpServerConfigurationException(
                    "Required authenticate user SQL statement not provided");
        }
       
        return new DbUserManager(dataSource, selectAllStmt, selectUserStmt,
                insertUserStmt, updateUserStmt, deleteUserStmt, authenticateStmt,
View Full Code Here

                    defaultResourceName);
            if (in != null) {
                try {
                    pair.defaultProperties.load(in);
                } catch (IOException e) {
                    throw new FtpServerConfigurationException(
                            "Failed to load messages from \"" + defaultResourceName + "\", file not found in classpath");
                }
            } else {
                throw new FtpServerConfigurationException(
                        "Failed to load messages from \"" + defaultResourceName + "\", file not found in classpath");
            }
        } finally {
            IoUtils.close(in);
        }

        // load custom resource
        File resourceFile = null;
        if (lang == null) {
            resourceFile = new File(customMessageDirectory, "FtpStatus.gen");
        } else {
            resourceFile = new File(customMessageDirectory, "FtpStatus_" + lang
                    + ".gen");
        }
        in = null;
        try {
            if (resourceFile.exists()) {
                in = new FileInputStream(resourceFile);
                pair.customProperties.load(in);
            }
        } catch (Exception ex) {
            LOG.warn("MessageResourceImpl.createPropertiesPair()", ex);
            throw new FtpServerConfigurationException(
                    "MessageResourceImpl.createPropertiesPair()", ex);
        } finally {
            IoUtils.close(in);
        }
View Full Code Here

            } else {
                LOG.debug("Trying to load store from classpath");
                fin = getClass().getClassLoader().getResourceAsStream(storeFile.getPath());
               
                if(fin == null) {
                    throw new FtpServerConfigurationException("Key store could not be loaded from " + storeFile.getPath());
                }
            }
           
            KeyStore store = KeyStore.getInstance(storeType);
            store.load(fin, storePass.toCharArray());
View Full Code Here

                    keyManagerFactory, trustManagerFactory,
                    clientAuth, sslProtocol,
                    enabledCipherSuites, keyAlias);
        } catch (Exception ex) {
            LOG.error("DefaultSsl.configure()", ex);
            throw new FtpServerConfigurationException("DefaultSsl.configure()",
                    ex);
        }
    }
View Full Code Here

                SslConfiguration ssl = getSslConfiguration();
                SslFilter sslFilter;
                try {
                    sslFilter = new SslFilter(ssl.getSSLContext());
                } catch (GeneralSecurityException e) {
                    throw new FtpServerConfigurationException("SSL could not be initialized, check configuration");
                }
   
                if (ssl.getClientAuth() == ClientAuth.NEED) {
                    sslFilter.setNeedClientAuth(true);
                } else if (ssl.getClientAuth() == ClientAuth.WANT) {
                    sslFilter.setWantClientAuth(true);
                }
   
                if (ssl.getEnabledCipherSuites() != null) {
                    sslFilter.setEnabledCipherSuites(ssl.getEnabledCipherSuites());
                }
   
                acceptor.getFilterChain().addFirst("sslFilter", sslFilter);
            }
   
            handler.init(context, this);
            acceptor.setHandler(new FtpHandlerAdapter(context, handler));
   
            try {
                acceptor.bind(address);
            } catch (IOException e) {
                throw new FtpServerConfigurationException("Failed to bind to address " + address + ", check configuration", e);
            }
   
            // update the port to the real port bound by the listener
            setPort(acceptor.getLocalAddress().getPort());
        } catch(RuntimeException e) {
View Full Code Here

     */
    public Listener createListener() {
      try{
        InetAddress.getByName(serverAddress);
      }catch(UnknownHostException e){
        throw new FtpServerConfigurationException("Unknown host",e);
      }
        return new NioListener(serverAddress, port, implicitSsl, ssl,
                dataConnectionConfig, idleTimeout, blockedAddresses,
                blockedSubnets);
    }
View Full Code Here

TOP

Related Classes of org.apache.ftpserver.FtpServerConfigurationException

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.