my dog learned polymorphism*
The moose likes Sockets and Internet Protocols and the fly likes Specified file not found Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Specified file not found" Watch "Specified file not found" New topic
Author

Specified file not found

yathish Gatty
Ranch Hand

Joined: Oct 05, 2004
Posts: 31
Hi,
I am using org.apache.commons.net library for ftpclient.When I try to access the directory in the ftp server I get the 550:The specified file not error.But that file is there in the ftp server.
The code written is given below:

package com.ftp;

import java.io.IOException;

import org.apache.commons.net.ftp.DefaultFTPFileListParser;
import org.apache.commons.net.ftp.FTPClient;
import org.apache.commons.net.ftp.FTPFile;
import org.apache.commons.net.ftp.FTPFileEntryParser;
import org.apache.commons.net.ftp.FTPFileEntryParserImpl;
import org.apache.commons.net.ftp.FTPFileList;
import org.apache.commons.net.ftp.FTPListParseEngine;
import org.apache.commons.net.ftp.parser.CompositeFileEntryParser;
import org.apache.commons.net.ftp.parser.DefaultFTPFileEntryParserFactory;
import org.apache.commons.net.ftp.parser.FTPFileEntryParserFactory;
import org.apache.commons.net.ftp.parser.VMSFTPEntryParser;



public class FtpCrawler {

static FTPClient ftp=new FTPClient();
public static void main(String[] args) {
try {

String server="10.16.56.216";

String directory="/lib/account lib/";
ftp.connect(server);
ftp.login(args[0],args[1]);
FTPFile[] files=ftp.listFiles(directory);

for(int i=0;i<files.length;i++){

}


System.out.println("Connected to " + server + ".");
System.out.print(ftp.getReplyString());






ftp.disconnect();

} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}


}
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Specified file not found
 
Similar Threads
Problem with my FTP client Program: MalformedPatternException
Reading log files from various unix servers through Java program on windows
Problem with InputStream using org.apache.commons.net
Problem with InputStream using org.apache.commons.net
Specified file not found