Example usage for org.apache.commons.net.ftp FTPListParseEngine getFiles

List of usage examples for org.apache.commons.net.ftp FTPListParseEngine getFiles

Introduction

In this page you can find the example usage for org.apache.commons.net.ftp FTPListParseEngine getFiles.

Prototype

public FTPFile[] getFiles(FTPFileFilter filter) throws IOException 
    

Source Link

Document

Returns an array of FTPFile objects containing the whole list of files returned by the server as read by this object's parser.

Usage

From source file:com.atomicleopard.thundr.ftp.commons.FTPClient.java

/**
 * Generate a directory listing using the MLSD command.
 *
 * @param pathname the directory name, may be {@code null}
 * @param filter the filter to apply to the responses
 * @return the array of file entries//from   ww w. ja va2  s .  co  m
 * @throws IOException
 * @since 3.0
 */
public FTPFile[] mlistDir(String pathname, FTPFileFilter filter) throws IOException {
    FTPListParseEngine engine = initiateMListParsing(pathname);
    return engine.getFiles(filter);
}

From source file:com.atomicleopard.thundr.ftp.commons.FTPClient.java

/**
 * Version of {@link #listFiles(String)} which allows a filter to be provided.
 * For example: <code>listFiles("site", FTPFileFilters.DIRECTORY);</code>
 * @param pathname the initial path, may be null
 * @param filter the filter, non-null/*from  w w w  .  j  a va2 s  .co m*/
 * @return the list of FTPFile entries.
 * @throws IOException
 * @since 2.2
 */
public FTPFile[] listFiles(String pathname, FTPFileFilter filter) throws IOException {
    FTPListParseEngine engine = initiateListParsing((String) null, pathname);
    return engine.getFiles(filter);

}