Mario,
There is the initialization code :
private void initExportConf() {
try {
try {
go_ftpServerConfig = go_configManager
.getExportFtpServerConfig();
} catch (ConfigException ex) {
go_logger
.debug("There is no configuration to export XML files.");
return;
}
go_exportFileSystemOptions = null;
go_exportFileSystemOptions = new FileSystemOptions();
StaticUserAuthenticator auth = new StaticUserAuthenticator("",
go_ftpServerConfig.getUsername(), go_ftpServerConfig
.getPassword());
go_exportFileSystemOptions = new FileSystemOptions();
DefaultFileSystemConfigBuilder.getInstance().setUserAuthenticator(
go_exportFileSystemOptions, auth);
FtpFileSystemConfigBuilder.getInstance().setPassiveMode(
go_exportFileSystemOptions, go_ftpServerConfig.isPassiv());
go_fileSystemManager = new StandardFileSystemManager();
go_fileSystemManager.setCacheStrategy(CacheStrategy.MANUAL);
go_fileSystemManager.init();
} catch (Exception ex) {
go_logger.error(
"Error on initialize Export configuration FTPServer.", ex);
}
}
And there is where I move my file on the FTP server :
private void exportFile(FileObject po_fileObject) throws Exception{
String ls_destinationFileName = "ftp://10.0.0.0/tmp.xml";
FileObject lo_target = go_fileSystemManager.resolveFile(
ls_destinationFileName, go_exportFileSystemOptions);
lo_targetTmp.moveTo(lo_target);
}
I have seen in the commons-vfs, the "List" operation are done on :
- On test if destination file exists (AbstractFileObject, ln 944)
- When file is copied (AbstractFileObject, ln 983)
Thanks
-----Original Message-----
From: Mario Ivankovits [mailto:[EMAIL PROTECTED]
Sent: jeudi, 12. avril 2007 14:19
To: Nicolas Rouiller
Subject: Re: Move/copy operations take long time
Hi Nicolas!
> I use commons-vfs in my project and I have a problem : I move some
> files on a FTP server and this operation takes long time. I have
> analysed the problem with a network sniffer and I have seen that there
> is several times the "List" operation. I have many files in the FTP
> folder and the operation "List" take a lot of time.
Hmm ... how do your code look like?
Do you know when exactly the list operation will be issued?
BTW, please post questions to the apache commons-user mailinglist [1].
Ciao,
Mario
[1] http://jakarta.apache.org/site/mail2.html#Commons
----------------------------------------------------------------------------
----
From: Nicolas Rouiller [mailto:[EMAIL PROTECTED]
Sent: jeudi, 12. avril 2007 14:06
To: '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]'
Subject: Move/copy operations take long time
Hi,
I use commons-vfs in my project and I have a problem : I move some files on
a FTP server and this operation takes long time. I have analysed the problem
with a network sniffer and I have seen that there is several times the
"List" operation. I have many files in the FTP folder and the operation
"List" take a lot of time.
Is there a way to avoid these "List" operations during a copy/move? I have
already try to set my CacheStrategy to "Manual" but that doesn't change
anything.
Thanks for your help.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]