Package org.jboss.fresh.vfs

Examples of org.jboss.fresh.vfs.RootVFS


      out.close();
      log.debug("done");
      return;
    }

    RootVFS rootfs = null;

    RegistryContext ctx = new RegistryContext();
    try {
      rootfs = (RootVFS) ctx.lookup("java:/CP2/VFS");
    } catch(ClassCastException ex) {
      error("VFS bound at java:/CP2/VFS is not RootVFS");
      return;
    } catch(NameNotFoundException ex) {
      error("Root VFS not bound (should be at: java:/CP2/VFS)");
      return;     
    }

    if(params.length == 0) {
      Iterator it = rootfs.listMounts().entrySet().iterator();
      while(it.hasNext()) {
        Map.Entry ent = (Map.Entry) it.next();       
        out.println(ent.getKey() + "\t\t" + ent.getValue());
      }
   
      out.flush();
      return;
    }
   

    String path = params[0];
    String jndi = params[1];
    VFS vfs = null;

    try {
      vfs = (VFS) ctx.lookup(jndi);
    } catch(NameNotFoundException ex) {
      error("No VFS bound at: " + jndi);
      return;
    }


    if(rootfs instanceof RootVFS) {
      rootfs.mount(path, vfs);
    } else {
      error("Root VFS does not implement RootVFS - doesn't support mounting");
      return;
    }
View Full Code Here

TOP

Related Classes of org.jboss.fresh.vfs.RootVFS

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.