Package org.apache.ftpserver.ftplet

Examples of org.apache.ftpserver.ftplet.FtpException


     * Get <code>InetAddress</code>.
     */
    public InetAddress getInetAddress(final String str) throws FtpException {
        String value = getProperty(str);
        if(value == null) {
            throw new FtpException(str + " not found");
        }
       
        try {
            return InetAddress.getByName(value);
        }
        catch(UnknownHostException ex) {
            throw new FtpException("Host " + value + " not found");
        }
    }
View Full Code Here


     * Get <code>String</code>.
     */
    public String getString(final String str) throws FtpException {
        String value = getProperty(str);
        if(value == null) {
            throw new FtpException(str + " not found");
        }
       
        return value;
    }
View Full Code Here

     * Get <code>File</code> object.
     */
    public File getFile(final String str) throws FtpException  {
        String value = getProperty(str);
        if (value == null) {
            throw new FtpException(str + " not found");
        }
        return new File(value);
    }
View Full Code Here

     * Get <code>Class</code> object
     */
    public Class<?> getClass(final String str) throws FtpException  {
        String value = getProperty(str);
        if (value == null) {
            throw new FtpException(str + " not found");
        }

        try {
            return Class.forName(value);
        }
        catch (ClassNotFoundException ex) {
            throw new FtpException("BaseProperties.getClass()", ex);
        }
    }
View Full Code Here

     * Get <code>TimeZone</code>
     */
    public TimeZone getTimeZone(final String str) throws FtpException  {
        String value = getProperty(str);
        if (value == null) {
            throw new FtpException(str + " not found");
        }
        return TimeZone.getTimeZone(value);
    }
View Full Code Here

     * Get <code>DateFormat</code> object.
     */
    public SimpleDateFormat getDateFormat(final String str) throws FtpException  {
        String value = getProperty(str);
        if (value == null) {
            throw new FtpException(str +  " not found");
        }
        try {
        return new SimpleDateFormat(value);
        } catch(IllegalArgumentException e) {
            throw new FtpException("Date format was incorrect: " + value, e);
        }
    }
View Full Code Here

     * Get <code>Date</code> object.
     */
    public Date getDate(final String str, final DateFormat fmt) throws FtpException  {
        String value = getProperty(str);
        if (value == null) {
            throw new FtpException(str + " not found");
        }

        try {
            return fmt.parse(value);
        }
        catch (ParseException ex) {
            throw new FtpException("BaseProperties.getdate()", ex);
        }
    }
View Full Code Here

           
            LOG.info("LDAP user manager opened.");
   
        } catch(Exception ex) {
            LOG.error("LdapUserManager.configure()", ex);
            throw new FtpException("LdapUserManager.configure()", ex);
        }
    }
View Full Code Here

            Collections.sort(allUsers);
            return allUsers.toArray(new String[0]);
        }
        catch(NamingException ex) {
            LOG.error("LdapUserManager.getAllUserNames()", ex);
            throw new FtpException("LdapUserManager.getAllUserNames()", ex);
        }
    }
View Full Code Here

            LOG.info("Rebinding user " + dn);
            adminContext.rebind(dn, newUser, attrs);
        }
        catch(NamingException ex) {
            LOG.error("LdapUserManager.save()", ex);
            throw new FtpException("LdapUserManager.save()", 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.