Description
The GetFTPDirectoryList PIM retrieves a directory listing from a designated FTP account and path. The PIM retrieves the directory listing by using the FTP.java class to establish the FTP connection, send the FTP.CWD command to change directories to the one specified in the path, and send the FTP.LIST command. The PIM is capable of connecting to both WINNT and UNIX based machines. After executing the FTP.LIST command the PIM checks the format of the response to determine what type of host the response was generated by and then builds a product accordingly. Each line of the response (that is not a directory) is used to create a URL which is then stored in a BasicProduct. A VectorProduct is used as a container for all the BasicProducts.
Configuration Variables
ftpUrlThe FTP URL (ftp://host.mitre.org/) to connect to. This variable is required as there is no useful default.NOTE: A path is REQUIRED in the URL. The forwardslash '/' indicates the root directory. A users "home" directory must be explicitly defined as the path in the URL. Failure to define a path will cause an exception to be thrown.
user
The user name needed to login to the host system. This variable is required.password
The password that accompanies the user name. This variable is required as there can not be a default.
Product
The PIM produces a VectorProduct used as a container. The id of the container is the id of the PIM. The description of the container is the description of the PIM. The container holds one BasicProduct per line of response received (not including directories). The id and description of each BasicProduct is the id and description of the PIM. The content of each BasicProduct is a URL constructed from the lines of response.
How it works
Using the ftpUrl, user, and password, the PIM attempts to connect to the FTP site. If there is a problem establishing a connection the PIM will throw an IOException.Once connected the PIM sends the FTP.CWD command, along with the path variable as an argument, to change directories. Then the FTP.LIST command is sent to retrieve the directory listing. After the listing is retrieved the PIM analyzes the format of the response (based on column spacing) to determine what type of host generated the response (WINNT or UNIX), and then constructs a product accordingly.
First Available: Build 24
Revised: 19 Sep 1998