Mario,
Thanks a lot for responding quickly. i tried running FtpCheck and was
able to see the remote folders. i didnt get any null entries. i also
tried sftp yesterday and that seems to be working. i should be able
to manage with sftp. Thanks a lot for looking in to this!
[java] System: UNIX Type: L8 Version: BSD-199506
[java] #0: drwx------ 3 pulsar00 consumer 102 May 8 11:05
Desktop
[java] #0: drwx------ 3 pulsar00 consumer 102 May 8 11:05
Desktop
[java] name:Desktop type:1
[java] #1: drwx------ 3 pulsar00 consumer 102 May 8 11:05
Documents
[java] #1: drwx------ 3 pulsar00 consumer 102 May 8 11:05
Documents
[java] name:Documents type:1
[java] #2: drwx------ 17 pulsar00 consumer 578 May 8 11:05
Library
[java] #2: drwx------ 17 pulsar00 consumer 578 May 8 11:05
Library
[java] name:Library type:1
[java] #3: drwx------ 3 pulsar00 consumer 102 May 8 11:05
Movies
[java] #3: drwx------ 3 pulsar00 consumer 102 May 8 11:05
Movies
[java] name:Movies type:1
Rgds
Anajna
From
Mario Ivankovits <[EMAIL PROTECTED]>
Subject
Re: [commons vfs] - Issues while trying to ftp to a remote server
Date
Wed, 16 Aug 2006 07:33:37 GMT
Hi Anjana!
> jarFile = (FtpFileObject)
> fsManager.resolveFile("ftp://pulsar007:[EMAIL PROTECTED]/",opts);
> But when i try to list the children, i get an error. i tried getting
> the latest vfs version, commons-vfs-20060815.jar. when i do ftp
> manually to this host, i dont have any issues. Can some one please
> guide me? Thanks!
Maybe it is the localization issue.
VFS uses commons-net to access the server. commons-net parses the
directory response to create the list of children. To make this work
commons-net needs to know the language used if it is not english.
The FtpFileSystemConfigBuilder provides some setters to configure the
commons-net language settings.
To see if the default commons-net setup correctly recognize the
directory listing you can use
java org.apache.commons.vfs.libcheck.FtpCheck username password host
directory
If you also get null entries with it, you have to configure the language
settings.
Please see
http://jakarta.apache.org/commons/net/api/org/apache/commons/net/ftp/
FTPClientConfig.html
for a detailed description, it should be easy to map it to the
FtpFileSystemConfigBuilder.
Please report back if this did the trick.
Thanks!
Ciao,
Mario
Anjana Gopinath
On Aug 15, 2006, at 1:08 PM, Anjana Gopinath wrote:
Hi,
i am a new user of vfs. i am trying to connect to a remote server
using ftp
FileSystemOptions opts = new FileSystemOptions();
FtpFileSystemConfigBuilder.getInstance().setUserDirIsRoot(opts,
true);
FtpFileObject jarFile = null;
try {
File file = new File("/");
jarFile = (FtpFileObject) fsManager.resolveFile("ftp://
pulsar007:[EMAIL PROTECTED]/",opts);
} catch (FileSystemException e1) {
e1.printStackTrace();
}
But when i try to list the children, i get an error. i tried
getting the latest vfs version, commons-vfs-20060815.jar. when i do
ftp manually to this host, i dont have any issues. Can some one
please guide me? Thanks!
[java] org.apache.commons.vfs.FileSystemException: Could not
determine the type of file "ftp://pulsar007:[EMAIL PROTECTED]/".
[java] at
org.apache.commons.vfs.provider.AbstractFileObject.attach
(AbstractFileObject.java:1281)
[java] at
org.apache.commons.vfs.provider.AbstractFileObject.getType
(AbstractFileObject.java:410)
[java] at
org.apache.commons.vfs.provider.AbstractFileObject.exists
(AbstractFileObject.java:400)
[java] at org.apache.commons.vfs.example.Test.main(Test.java:62)
[java] Caused by: org.apache.commons.vfs.FileSystemException:
Object didnt extend from AbstractFileObject. Object "null"
[java] at
org.apache.commons.vfs.util.FileObjectUtils.getAbstractFileObject
(FileObjectUtils.java:50)
[java] at
org.apache.commons.vfs.provider.ftp.FtpFileObject.getInfo
(FtpFileObject.java:174)
[java] at
org.apache.commons.vfs.provider.ftp.FtpFileObject.doAttach
(FtpFileObject.java:166)
[java] at
org.apache.commons.vfs.provider.AbstractFileObject.attach
(AbstractFileObject.java:1267)
Anjana Gopinath