/*
 * @(#)FtpFileParser.java
 *
 * Copyright (c) 2003 JSCAPE
 * 1147 S. 53rd Pl., Mesa, Arizona, 85206, U.S.A.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * JSCAPE. ("Confidential Information").  You shall not disclose such
 * Confidential Information and shall use it only in accordance with
 * the terms of the license agreement you entered into with JSCAPE.
 */
package com.jscape.inet.ftp;

import java.io.BufferedReader;
import java.io.IOException;
import java.text.ParseException;
import java.util.Date;
import java.util.Enumeration;


/**
 * Interface to be implemented by classes responsible for parsing directory listings returned by various FTP servers.
 */
public interface FtpFileParser {

    /**
     * Method for parsing a directory listing returned by FTP server.
     *
     * @param in a BufferedReader passed in by Ftp class when invoking Ftp#getDirListing method
     *
     * @return an <code>Enumeration</code> of <code>FtpFile</code>
     *
     * @throws IOException if an I/O or FTP related error occurs
     * @see FtpFile
     * @see Ftp#getDirListing
     */
    Enumeration parse(BufferedReader in)
            throws IOException;

    /**
     * Parses a string which contains a date a returns a date object
     *
     * @param date The string will be parsed
     *
     * @return A object date which corresponds with the input string argument
     *
     * @throws ParseException if an error ocurrs
     */
    Date getFileDate(String date)
            throws ParseException;

    Date getDateTime(FtpFile file)
            throws ParseException;

}
