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

        Element remoteIpFilterElement = SpringUtil.getChildElement(element,
                FtpServerNamespaceHandler.FTPSERVER_NS, "remote-ip-filter");
        if (remoteIpFilterElement != null) {
            if (blacklistElm != null) {
                throw new FtpServerConfigurationException(
                        "Element 'remote-ip-filter' may not be used when 'blacklist' element is specified. ");
            }
            String filterType = remoteIpFilterElement.getAttribute("type");
            try {
                RemoteIpFilter remoteIpFilter = new RemoteIpFilter(IpFilterType
View Full Code Here

     */
    public Listener createListener() {
        try {
            InetAddress.getByName(serverAddress);
        } catch (UnknownHostException e) {
            throw new FtpServerConfigurationException("Unknown host", e);
        }
        // Deal with the old style black list and new session Filter here.
        if (sessionFilter != null) {
            if (blockedAddresses != null || blockedSubnets != null) {
                throw new IllegalStateException(
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);
            }
           
            updatePort();
   
        } catch(RuntimeException e) {
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

                con = createConnection();
               
                LOG.info("Database connection opened.");
        } catch (SQLException ex) {
                LOG.error("Failed to open connection to user database", ex);
                throw new FtpServerConfigurationException(
                "Failed to open connection to user database", ex);
        } finally{
                closeQuitely(con);
        }
    }
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);
            }
           
            updatePort();
   
        } catch(RuntimeException e) {
View Full Code Here

            createConnection();

            LOG.info("Database connection opened.");
        } catch (SQLException ex) {
            LOG.error("Failed to open connection to user database", ex);
            throw new FtpServerConfigurationException(
                    "Failed to open connection to user database", ex);
        }
    }
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

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.