Package org.apache.ftpserver.ftplet

Examples of org.apache.ftpserver.ftplet.FtpException


            stmt = createConnection().createStatement();
            rs = stmt.executeQuery(sql);
            return rs.next();
        } catch (SQLException ex) {
            LOG.error("DbUserManager.doesExist()", ex);
            throw new FtpException("DbUserManager.doesExist()", ex);
        } finally {
            closeQuitely(rs);
            closeQuitely(stmt);
        }
    }
View Full Code Here


                names.add(rs.getString(ATTR_LOGIN));
            }
            return names.toArray(new String[0]);
        } catch (SQLException ex) {
            LOG.error("DbUserManager.getAllUserNames()", ex);
            throw new FtpException("DbUserManager.getAllUserNames()", ex);
        } finally {
            closeQuitely(rs);
            closeQuitely(stmt);
        }
    }
View Full Code Here

                session.write(FtpReplyUtil.translate(session, request, context, 234, "AUTH.SSL", null));
            } catch(FtpException ex) {
                throw ex;
            } catch(Exception ex) {
                LOG.warn("AUTH.execute()", ex);
                throw new FtpException("AUTH.execute()", ex);
            }
        }
        else if(authType.equals("TLS")) {
            try {
                secureSession(session, "TLS");
                session.write(FtpReplyUtil.translate(session, request, context, 234, "AUTH.TLS", null));
            } catch(FtpException ex) {
                throw ex;
            } catch(Exception ex) {
                LOG.warn("AUTH.execute()", ex);
                throw new FtpException("AUTH.execute()", ex);
            }
        }
        else {
            session.write(FtpReplyUtil.translate(session, request, context, FtpReply.REPLY_502_COMMAND_NOT_IMPLEMENTED, "AUTH", null));
        }
View Full Code Here

                sslFilter.setEnabledCipherSuites(ssl.getEnabledCipherSuites());
            }
            session.getFilterChain().addFirst("sslSessionFilter", sslFilter);

        } else {
            throw new FtpException("Socket factory SSL not configured");
        }
    }
View Full Code Here

            if(server == null) {
                // get configuration
                FtpServer server = getConfiguration(args);
                if(server == null) {
                    LOG.error("No configuration provided");
                    throw new FtpException("No configuration provided");
                }
            }
           
            String command = "start";
           
View Full Code Here

     * Get boolean value.
     */
    public boolean getBoolean(final String str) throws FtpException {
        String prop = getProperty(str);
        if (prop == null) {
            throw new FtpException(str + " not found");
        }

        return prop.toLowerCase().equals("true");
    }
View Full Code Here

                } else {
                    System.err.println("XML configuration does not contain a server configuration");
                }
            }
        } else {
            throw new FtpException("Invalid configuration option");
        }
       
        return server;
    }
View Full Code Here

     * Get integer value.
     */
    public int getInteger(final String str) throws FtpException  {
        String value = getProperty(str);
        if (value == null) {
            throw new FtpException(str + " not found");
        }

        try {
            return Integer.parseInt(value);
        }
        catch (NumberFormatException ex) {
            throw new FtpException("BaseProperties.getInteger()", ex);
        }
    }
View Full Code Here

     * Get long value.
     */
    public long getLong(final String str) throws FtpException {
        String value = getProperty(str);
        if (value == null) {
            throw new FtpException(str + " not found");
        }

        try {
            return Long.parseLong(value);
        }
        catch (NumberFormatException ex) {
            throw new FtpException("BaseProperties.getLong()", ex);
        }
    }
View Full Code Here

     * Get double value.
     */
    public double getDouble(final String str) throws FtpException  {
        String value = getProperty(str);
        if (value == null) {
            throw new FtpException(str + " not found");
        }

        try {
            return Double.parseDouble(value);
        }
        catch (NumberFormatException ex) {
            throw new FtpException("BaseProperties.getDouble()", ex);
        }
    }
View Full Code Here

TOP

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

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.