Examples of FTPException


Examples of org.apache.ftpserver.ftplet.FtpException

     * 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

Examples of org.apache.ftpserver.ftplet.FtpException

     * 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

Examples of org.apache.ftpserver.ftplet.FtpException

     * 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

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

Examples of org.apache.ftpserver.ftplet.FtpException

     * 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

Examples of org.apache.ftpserver.ftplet.FtpException

     * 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

Examples of org.apache.ftpserver.ftplet.FtpException

     * 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

Examples of org.apache.ftpserver.ftplet.FtpException

     * 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

Examples of org.apache.ftpserver.ftplet.FtpException

     * 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

Examples of org.apache.ftpserver.ftplet.FtpException

     * 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
TOP
Copyright © 2018 www.massapi.com. 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.