01: /*
02: * Copyright 2001-2005 The Apache Software Foundation
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package org.apache.commons.net.ftp;
17:
18: import java.io.IOException;
19: import java.io.InputStream;
20:
21: /***
22: * FTPFileListParser defines the interface for parsing FTP file listings
23: * and converting that information into an array of
24: * {@link org.apache.commons.net.ftp.FTPFile} instances.
25: * Sometimes you will want to parse unusual listing formats, in which
26: * case you would create your own implementation of FTPFileListParser and
27: * if necessary, subclass FTPFile.
28: * <p>
29: * <p>
30: * @author Daniel F. Savarese
31: * @see FTPFile
32: * @see FTPClient#listFiles
33: * @deprecated This interface is deprecated as of version 1.2 and will be
34: * removed in version 2.0 -- use FTPFileEntryParser instead.
35: ***/
36:
37: public interface FTPFileListParser {
38:
39: /***
40: * Parses an FTP server file listing and converts it into a usable format
41: * in the form of an array of <code> FTPFile </code> instances. If the
42: * file list contains no files, <code> null </code> should be
43: * returned, otherwise an array of <code> FTPFile </code> instances
44: * representing the files in the directory is returned.
45: * <p>
46: * @param listStream The InputStream from which the file list should be
47: * read.
48: * @param encoding The encoding to use.
49: * @return The list of file information contained in the given path. null
50: * if the list could not be obtained or if there are no files in
51: * the directory.
52: * @exception IOException If an I/O error occurs reading the listStream.
53: ***/
54: FTPFile[] parseFileList(InputStream listStream, String encoding)
55: throws IOException;
56:
57: /***
58: * Parses an FTP server file listing and converts it into a usable format
59: * in the form of an array of <code> FTPFile </code> instances. If the
60: * file list contains no files, <code> null </code> should be
61: * returned, otherwise an array of <code> FTPFile </code> instances
62: * representing the files in the directory is returned.
63: * <p>
64: * @param listStream The InputStream from which the file list should be
65: * read.
66: * @return The list of file information contained in the given path. null
67: * if the list could not be obtained or if there are no files in
68: * the directory.
69: * @exception IOException If an I/O error occurs reading the listStream.
70: ***/
71: FTPFile[] parseFileList(InputStream listStream) throws IOException;
72:
73: }
|