001    /*
002     * ftp4j - A pure Java FTP client library
003     * 
004     * Copyright (C) 2008 Carlo Pelliccia (www.sauronsoftware.it)
005     * 
006     * This program is free software: you can redistribute it and/or modify
007     * it under the terms of the GNU General Public License as published by
008     * the Free Software Foundation, either version 3 of the License, or
009     * (at your option) any later version.
010     *
011     * This program is distributed in the hope that it will be useful,
012     * but WITHOUT ANY WARRANTY; without even the implied warranty of
013     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
014     * GNU General Public License for more details.
015     *
016     * You should have received a copy of the GNU General Public License
017     * along with this program.  If not, see <http://www.gnu.org/licenses/>.
018     */
019    package it.sauronsoftware.ftp4j;
020    
021    /**
022     * Implement this interface to build a new LIST parser. List parsers are called
023     * to parse the result of a FTP LIST command send to the server in the list()
024     * method. You can add a custom parser to your instance of FTPClient calling on
025     * it the method addListParser.
026     * 
027     * @author Carlo Pelliccia
028     * @see FTPClient#addListParser(FTPListParser)
029     */
030    public interface FTPListParser {
031    
032            /**
033             * Parses a LIST command response and builds an array of FTPFile objects.
034             * 
035             * @param lines
036             *            The response to parse, splitted by line.
037             * @return An array of FTPFile objects representing the result of the
038             *         operation.
039             * @throws FTPListParseException
040             *             If this parser cannot parse the given response.
041             */
042            public FTPFile[] parse(String[] lines) throws FTPListParseException;
043    
044    }