Package org.apache.ftpserver.ftplet

Examples of org.apache.ftpserver.ftplet.FtpException


     * 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


     * 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

     * 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

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.