Directory File List

To get server file names for directory download, in file record for directory download, use the getDirectoryFileList() method of the file record to return FTClient.DirectoryElementList[], an array of FTClient.DirectoryElementList, which represents the structure of the directory to be downloaded. You should parse the structure to get the entire list of server file names.

Major part of source code of this class (extracted from the FTClient.jar file) is as follows:

package FTClient;

public class DirectoryElementList  implements java.io.Serializable {
    private java.lang.String elementName;
    private java.lang.String elementType;
    private FTClient.DirectoryElementList[] subDirectoryList;

    public DirectoryElementList() {
    }

    public java.lang.String getElementName() {
        return elementName;
    }

    public void setElementName(java.lang.String elementName) {
        this.elementName = elementName;
    }

    public java.lang.String getElementType() {
        return elementType;
    }

    public void setElementType(java.lang.String elementType) {
        this.elementType = elementType;
    }

    public FTClient.DirectoryElementList[] getSubDirectoryList() {
        return subDirectoryList;
    }

    public void setSubDirectoryList(FTClient.DirectoryElementList[] subDirectoryList) {
        this.subDirectoryList = subDirectoryList;
}

…
}

If the value of the elementType parameter is F, this element is the leaf node and the elementName parameter is a server file name. If the values of the elementType parameter is D, this element is a subdirectory and you should go into the directory, maybe recursively, to find the file name.