commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bakary Dialaya DJIBA" <>
Subject [ understand VFS ]
Date Tue, 23 Sep 2008 19:37:46 GMT

Given a FileSystem *fs* (extends abstractFS) and a FileObject *fo *(extends
AbstractFO), how can I attach the fo to the fs?

It's a silly question. I am trying to create a provider that I'll add to
the default manager (of VFS). The provider is added successfully but I
cannot make a link between *fs* and *fo*.

To do this I write the code below:

DefaultFileSystemManager manager new DefaultFileSystemManager();
MyProvider provider = new MyProvider();
FileSystemOptions fileSystemOptions = new FileSystemOptions();

manager.addProvider("sch", provider);

CustomFileObject fo = (CustomFileObject)manager.resolveFile("sch:/");

CustomFileName fn = new CustomFileName("sch", "userName",FileType.FOLDER);

CustomFileSystem fs = new CustomFileSystem(fn,fileSystemOptions);
System.out.println(fo.isAttached()); // return false
System.out.println(fo.isAttached()); // return false

My second problème is that I don't know how to set my root file system. And
also fo.getParent() throw a null pointer exception.

Someone can tell me how to do this:

 |__FileObject1 ...
 |__FileObject2 ...

or give me a tutorial to understand VFS API.

Thanks & Regards.


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