Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Problem with "ChangeworkingDirectory" of org.apache.commons.net.ftp.FTP

807589Mar 7 2007 — edited Sep 11 2008
Hi All,
Im using the following piece of code to get the list of files from a directory using FtpClient
try
             {
	String folder="/prod/inx/logs/fe";
	ftp.changeWorkingDirectory(folder);

	files = ftp.listFiles();
	List filesDirs = Arrays.asList(files);
	if(!(filesDirs.isEmpty()))
	{
	System.out.println("Working dir :"+ftp.printWorkingDirectory());
	}
                } 
I have already created the ftp object . My problem is , the function changeWorkingDirectory() is not working. when i try to print the workingdirectory its printing "null". Please help
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 9 2008
Added on Mar 7 2007
11 comments
2,778 views