[jboss-dev-forums] [Design of POJO Server] - Re: VFS issues

adrian@jboss.org do-not-reply at jboss.com
Wed Sep 6 07:57:03 EDT 2006


The slight difference due to the simplification of the api can be
seen in this example:

Old test

  |       VFSFactory factory = VFSFactoryLocator.getFactory(rootURL);
  |       ReadOnlyVFS vfs = factory.getVFS(rootURL);
  | 
  |       // Check resolving the root file
  |       VirtualFile root = vfs.resolveFile("");
  | 
  |       // Find the outer.jar
  |       VirtualFile outerJar = vfs.resolveFile("outer.jar");
  | 

New test

  |       VFS vfs = VFS.getVFS(rootURL);
  | 
  |       // Check resolving the root file
  |       VirtualFile root = vfs.findChildFromRoot("");
  | 
  |       // Find the outer.jar
  |       VirtualFile outerJar = vfs.findChildFromRoot("outer.jar");
  | 

Additionally, the new stuff supports the follow factory methods
which are really just wrappers to the other primitives.

  | // establish a context and get a file
  | vfs.getVirtualFile(rootURL, "outer.jar");
  | 
  | // Simplified access to the root
  | vfs.getRoot(); == vfs.findChildFromRoot("");
  | 
  | // Relative access
  | VirtualFile outer = vfs.getVirtualFile(rootURL, "outer.jar");
  | vfs.findChild(outer, "META-INF/MANIFEST.MF");
  | 
  | // The latter is really just the simpler
  | outer.findChild("META-INF/MANIFEST.MF");
  | 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3969713#3969713

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3969713



More information about the jboss-dev-forums mailing list