jQuery in Action, 3rd edition
The moose likes Java in General and the fly likes Urgent Ftp Command Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Urgent Ftp Command Problem" Watch "Urgent Ftp Command Problem" New topic

Urgent Ftp Command Problem

Kalpesh Oza

Joined: Feb 25, 2002
Posts: 5
I am Using the below given command on dos after connected to ftp server
dir -R E:\directoryname\filename
so that I am able to get a list file of folders and subfolders.

I want to use the same command in java programme
in "issueCommand()" method of FtpClient class
Anyone who knows how to use it urgently give reply
Thomas Smets
Ranch Hand

Joined: Dec 11, 2001
Posts: 111
Read thoroughly and slowly the java.net.URL class description !
If you implement properly an FTP class, you should be able to implement the FTP as you want !
Here below is the most important part :
Creates a URL by parsing the given spec within a specified context. The new URL is created from the given context URL and the spec argument as described in RFC2396 "Uniform Resource Identifiers : Generic Syntax" :
The reference is parsed into the scheme, authority, path, query and fragment parts. If the path component is empty and the scheme, authority, and query components are undefined, then the new URL is a reference to the current document. Otherwise the any fragment and query parts present in the spec are used in the new URL. If the scheme component is defined in the given spec and does not match the scheme of the context, then the new URL is created as an absolute URL based on the spec alone. Otherwise the scheme component is inherited from the context URL. If the authority component is present in the spec then the spec is treated as absolute and the spec authority and path will replace the context authority and path. If the authority component is absent in the spec then the authority of the new URL will be inherited from the context. If the spec's path component begins with a slash character "/" then the path is treated as absolute and the spec path replaces the context path. Otherwise the path is treated as a relative path and is appended to the context path. The path is canonicalized through the removal of directory changes made by occurences of ".." and ".". For a more detailed description of URL parsing, refer to RFC2396.
context - the context in which to parse the specification.
spec - the String to parse as a URL.
MalformedURLException - if no protocol is specified, or an unknown protocol is found.

Thomas Smets
Just another developper
I agree. Here's the link: http://aspose.com/file-tools
subject: Urgent Ftp Command Problem
jQuery in Action, 3rd edition