1. /*
  2. * Copyright 2001-2004 The Apache Software Foundation
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  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. import java.io.IOException;
  18. import java.io.InputStream;
  19. /***
  20. * FTPFileListParser defines the interface for parsing FTP file listings
  21. * and converting that information into an array of
  22. * <a href="org.apache.commons.net.ftp.FTPFile.html"> FTPFile </a> instances.
  23. * Sometimes you will want to parse unusual listing formats, in which
  24. * case you would create your own implementation of FTPFileListParser and
  25. * if necessary, subclass FTPFile.
  26. * <p>
  27. * <p>
  28. * @author Daniel F. Savarese
  29. * @see FTPFile
  30. * @see FTPClient#listFiles
  31. * @deprecated This interface is deprecated as of version 1.2 and will be
  32. * removed in version 2.0 -- use FTPFileEntryParser instead.
  33. ***/
  34. public interface FTPFileListParser
  35. {
  36. /***
  37. * Parses an FTP server file listing and converts it into a usable format
  38. * in the form of an array of <code> FTPFile </code> instances. If the
  39. * file list contains no files, <code> null </code> should be
  40. * returned, otherwise an array of <code> FTPFile </code> instances
  41. * representing the files in the directory is returned.
  42. * <p>
  43. * @param listStream The InputStream from which the file list should be
  44. * read.
  45. * @return The list of file information contained in the given path. null
  46. * if the list could not be obtained or if there are no files in
  47. * the directory.
  48. * @exception IOException If an I/O error occurs reading the listStream.
  49. ***/
  50. FTPFile[] parseFileList(InputStream listStream) throws IOException;
  51. }