Package org.jboss.virtual.plugins.context.file

Examples of org.jboss.virtual.plugins.context.file.FileSystemContext$CheckForceCaseSensitive


   }
  
   protected VFSContext getVFSContext(String name) throws Exception
   {
      URL url = getRootResource(name);
      return new FileSystemContext(url);
   }


   }

   protected VFSContext getVFSContext(String name) throws Exception
   {
      URL url = getResource("/vfs/context/file/" + name + "/");
      return new FileSystemContext(url);
   }

   public void testJBVFS160() throws Exception
   {
      URI uri = new URI("file:////127.0.0.1/shared");
      File file = new File("\\\\127.0.0.1\\shared");

      FileSystemContext fsc = new FileSystemContext(uri);
      VirtualFileHandler vfh = fsc.createVirtualFileHandler(null, file);
      // this doesn't test anything as we don't have shared dir
      // more of a helper for actual usage
      System.out.println(vfh);
   }

      // unpack handler
      File copy = copy(guidDir, handler);

      String path = handler.getPathName();
      // create new handler
      FileSystemContext fileSystemContext = new TempContext(copy, oldVFSContext, path);

      // merge old options
      Options newOptions = fileSystemContext.getOptions();
      if (newOptions != null) // shouldn't be null, but we check anyway
      {
         Options oldOptions = oldVFSContext.getOptions();
         if (oldOptions != null && oldOptions.size() > 0)
            newOptions.merge(oldOptions);

         newOptions.addOption(VFSUtils.IS_TEMP_FILE, Boolean.TRUE);
         // save old handler
         newOptions.addOption(VirtualFileHandler.class.getName(), handler);
      }

      VirtualFileHandler newHandler = fileSystemContext.getRoot();
      oldVFSContext.addTempInfo(new BasicTempInfo(path, copy, newHandler));

      VirtualFileHandler parent = handler.getParent();
      if (parent != null && replaceOldHandler(parent, handler, newHandler))
         parent.replaceChild(handler, newHandler);

      assertVisited(visitor, expected, context);

      visitor.clear();

      URL url = getRootResource("children");
      FileSystemContext fsc = new FileSystemContext(url);
      assertVisited(visitor, expected, fsc);
   }

    */
   public void testCaseSensitive() throws Exception
   {
      URL rootURL = getResource("/vfs");

      FileSystemContext ctx = new FileSystemContext(new URL(rootURL.toString() + "?caseSensitive=true"));
      VirtualFileHandler root = ctx.getRoot();

      String path = "context/file/simple/child";
      VirtualFileHandler child = root.getChild(path);
      assertTrue("getChild('" + path + "')", child != null);


      return new TestSuite(FileVFSContextUnitTestCase.class);
   }

   protected VFSContext getVFSContext(URL url) throws Exception
   {
      return new FileSystemContext(url);
   }

   }

   protected VFSContext getVFSContext(String name) throws Exception
   {
      URL url = getResource("/vfs/context/file/" + name + "/");
      return new FileSystemContext(url);
   }

   }

   protected VFSContext getParentVFSContext() throws Exception
   {
      URL url = getResource("/vfs/context/file/");
      return new FileSystemContext(url);
   }

   }

   protected VFSContext getParentVFSContext() throws Exception
   {
      URL url = getResource("/vfs/context/jar/");
      return new FileSystemContext(url);
   }

TOP

Related Classes of org.jboss.virtual.plugins.context.file.FileSystemContext$CheckForceCaseSensitive

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.