Package org.apache.ftpserver

Examples of org.apache.ftpserver.FtpServerConfigurationException


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


            trustManagerFactory = TrustManagerFactory.getInstance(trustStoreAlgorithm);
            trustManagerFactory.init(trustStore);
        }
        catch(Exception ex) {
            LOG.error("DefaultSsl.configure()", ex);
            throw new FtpServerConfigurationException("DefaultSsl.configure()", ex);
        }
    }
View Full Code Here

    public void configure() {
        isConfigured  = true;
        File dir = userDataFile.getParentFile();
        if( (!dir.exists()) && (!dir.mkdirs()) ) {
            String dirName = dir.getAbsolutePath();
            throw new FtpServerConfigurationException("Cannot create directory for user data file : " + dirName);
        }
       
        if(!userDataFile.exists()) {
            try {
                userDataFile.createNewFile();
            } catch (IOException e) {
                throw new FtpServerConfigurationException("Cannot user data file : " + userDataFile.getAbsolutePath(), e);
            }
        }
        try {
            userDataProp = new BaseProperties(userDataFile);
        } catch (IOException e) {
            throw new FtpServerConfigurationException("Error loading user data file : " + userDataFile.getAbsolutePath(), e);
        }
       
        convertDeprecatedPropertyNames();
    }
View Full Code Here

       
        if(doSave) {
            try {
                saveUserData();
            } catch (FtpException e) {
                throw new FtpServerConfigurationException("Failed to save updated user data", e);
            }
        }
    }
View Full Code Here

            } else if("messages".equals(childName)) {
                MessageResource mr = parseMessageResource(childElm, parserContext, builder);
                builder.addPropertyValue("messageResource", mr);

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

        // Configure login limits
        DefaultConnectionConfig connectionConfig = new DefaultConnectionConfig();
View Full Code Here

            if("nio-listener".equals(ln)) {
                listener = parserContext.getDelegate().parseCustomElement(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");

            listeners.put(name, listener);
View Full Code Here

        if("bean".equals(ln)) {
            return parserContext.getDelegate().parseBeanDefinitionElement(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

    public static InetAddress parseInetAddress(final Element parent, 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

     */
    public void configure() {
        configured = true;
       
        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");
        }       
       
        try {
            // test the connection
            createConnection();
           
            LOG.info("Database connection opened.");
        }
        catch(SQLException ex) {
            LOG.error("DbUserManager.configure()", ex);
            throw new FtpServerConfigurationException("DbUserManager.configure()", ex);
        }
    }
View Full Code Here

            String propValue = config.getString(key, null);
           
            PropertyDescriptor descriptor = getDescriptor(clazz, key);
           
            if(descriptor == null) {
                throw new FtpServerConfigurationException("Unknown property \"" + key + "\" on class " + className);
            }

            Object value = createObject(descriptor.getPropertyType(), subConfig, propValue);

            setProperty(bean, descriptor, value);
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.