commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jens Viebig" <js...@gmx.de>
Subject [VFS] Specifying filesystem options globally ?
Date Fri, 09 Sep 2005 16:20:04 GMT
At the moment i use this code to create a ftp connection

       FileSystemManager fsManager = null;
       FileSystemOptions opts = null;
          fsManager = VFS.getManager();
          opts = new FileSystemOptions();
               
        DelegatingFileSystemOptionsBuilder builder = new DelegatingFileSystemOptionsBuilder(fsManager);
        // Filesystem options, TODO make configurable in xml
        builder.setConfigString(opts, "ftp", "passiveMode", "true");

        FileObject root = fsManager.resolveFile(ftpPath,opts);

I don't like that i always have to give the opts to the resolveFile method. is there a way
to specify options globally in the FileSystemManager so that every lookup of an ftp file is
done in passive mode without giving the opts ?

Regards Jens

btw. if i use this complete code in a loop, VFS is creating a new FTPClientWrapper for every
loop. Is this wanted behaviour ? After some time the jvm crashes because it can't create new
FTPClientWrapper.


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message