I used this URL. But it is taking as ftp:\username:password@servername\filepath\filenam e. And giving filenot found exception. saying incorrect path of folder/filename. please reply.
If it is taken as that, then you have used the wrong constructor.
read the JDK API about class File, you will see these 2 posbilities:
1.) File(String pathname)
Creates a new File instance by converting the given pathname string into an abstract pathname.
2.) File(URI uri)
Creates a new File instance by converting the given file: URI into an abstract pathname.
you should use the second one, of course, as I wrote "URL" before, and URI is part of URL.
here is an explanation of the difference, quoted from the JDK 1.3 API:
For Microsoft Windows platforms, the prefix of a pathname that contains a drive specifier consists of the drive letter followed by ":" and possibly followed by "\" if the pathname is absolute. The prefix of a UNC pathname is "\\"; the hostname and the share name are the first two names in the name sequence. A relative pathname that does not specify a drive has no prefix.