Pages Navigation Menu

Coding is much easier than you think

Listing System Help Using FTP

Listing System Help Using FTP


String listHelp() :This method retrieves the list of help information provided by the server and it returns the content in String. If there is no help information from the server then it will return null.

public String listHelp(String command) : Retrieves the help info from the ftp server for the specified command. Its return value in String.It returns null if there is no information.

command represents what you ask for help.

These methods throw FTPConnectionClosedException if server is closed before completion of operation and IOException, if there is any I/O error.

Example :

This example print the list of all the help info provided by the ftp server. We can list it by using FTPClient class method listHelp().

File : FtpHelpList.java


package com.simplecode.net;

import java.io.IOException;

import org.apache.commons.net.ftp.FTPClient;
import org.apache.commons.net.ftp.FTPConnectionClosedException;

class FtpHelpList {
	public static void main(String[] args) throws IOException {
		FTPClient ftpClient = new FTPClient();
		boolean result;
		try {
			// Connect to the localhost

			// login to ftp server
			result = ftpClient.login("admin", "admin");

			if (result == true) {
				System.out.println("User logged in successfully !");
			} else {
				System.out.println("Login failed !");

			// Get List of system help

			System.out.println("System Help Information.... ");

		} catch (FTPConnectionClosedException e) {
		} finally {
			try {
			} catch (FTPConnectionClosedException e) {


About Mohaideen Jamil

I'm a Full stack developer of IT exp in J2EE, AngularJs, MicroServices, Docker, Spring (Boot, MVC, Cloud), Bluemix, DevOps. Follow me on Facebook or Google Plus. If you like my tutorials, consider making a donation to this charity, thanks.

%d bloggers like this: