Package org.jboss.virtual.spi.registry

Examples of org.jboss.virtual.spi.registry.VFSRegistry


   protected VirtualFile getRoot(URL url, int parentDepth) throws IOException
   {
      log.trace("Root url: " + url);

      // try cache first, it should also have proper depth
      VFSRegistry registry = VFSRegistry.getInstance();
      VirtualFile vf = registry.getFile(url);
      int depth = parentDepth;
      while (vf != null && depth > 0)
      {
         vf = vf.getParent();
         depth--;
View Full Code Here


      {
         VirtualFileHandler contextHandler = context.getRoot();
         // the file is the context root, hence possible registry candidate
         if (fileHandler.equals(contextHandler))
         {
            VFSRegistry registry = VFSRegistry.getInstance();
            registry.removeContext(context);

            TempStore store = context.getTempStore();
            if (store != null)
            {
               store.clear();
View Full Code Here

   {
      VFSContextFactory factory = VFSContextFactoryLocator.getFactory(rootURI);
      if (factory == null)
         throw new IOException("No context factory for " + rootURI);

      VFSRegistry registry = VFSRegistry.getInstance();
      VFSContext context = registry.getContext(rootURI);
      if (context != null && createNew == false)
         return context.getVFS();

      if (context != null)
      {
         registry.removeContext(context);
         context.cleanup();
      }

      context = factory.getVFS(rootURI); // create new
      VFSRegistry.getInstance().addContext(context);
View Full Code Here

    * @throws IOException if there is a problem accessing the VFS
    * @throws IllegalArgumentException if the rootURL is null
    */
   public static VirtualFile getRoot(URI rootURI) throws IOException
   {
      VFSRegistry registry = VFSRegistry.getInstance();
      VirtualFile file = registry.getFile(rootURI);
      return (file != null) ? file : createNewRoot(rootURI);
   }
View Full Code Here

      return length;
   }

   protected URLConnection openConnection(URL url) throws IOException
   {
      VFSRegistry registry = VFSRegistry.getInstance();
      VirtualFile vf = registry.getFile(url);
      if (vf != null)
         return new VirtualFileURLConnection(url, vf);

      String file = URLDecoder.decode(url.toExternalForm(), "UTF-8").substring(getProtocolNameLength() + 1); // strip out vfs protocol + :
      URL vfsurl = null;
View Full Code Here

      assertEquals(size, counter);
   }

   protected void assertRegistryEntryExists(URI uri) throws Exception
   {
      VFSRegistry registry = VFSRegistry.getInstance();
      VirtualFile file = registry.getFile(uri);
      assertNotNull(file);
   }
View Full Code Here

      assertNotNull(file);
   }

   protected void assertNoRegistryEntry(URI uri) throws Exception
   {
      VFSRegistry registry = VFSRegistry.getInstance();
      VirtualFile file = registry.getFile(uri);
      assertNull("" + uri, file);
   }
View Full Code Here

      {
         VirtualFileHandler contextHandler = context.getRoot();
         // the file is the context root, hence possible registry candidate
         if (fileHandler.equals(contextHandler))
         {
            VFSRegistry registry = VFSRegistry.getInstance();
            registry.removeContext(context);
         }
      }
      catch (Exception e)
      {
         log.debug("Exception removing cached context, file=" + file, e);
View Full Code Here

    * @throws IOException if there is a problem accessing the VFS
    * @throws IllegalArgumentException if the rootURL is null
    */
   public static VirtualFile getRoot(URI rootURI) throws IOException
   {
      VFSRegistry registry = VFSRegistry.getInstance();
      VirtualFile file = registry.getFile(rootURI);
      return (file != null) ? file : createNewRoot(rootURI);
   }
View Full Code Here

    * @throws IOException if there is a problem accessing the VFS
    * @throws IllegalArgumentException if the rootURL
    */
   public static VirtualFile getRoot(URL rootURL) throws IOException
   {
      VFSRegistry registry = VFSRegistry.getInstance();
      VirtualFile file = registry.getFile(rootURL);
      return (file != null) ? file : createNewRoot(rootURL);
   }
View Full Code Here

TOP

Related Classes of org.jboss.virtual.spi.registry.VFSRegistry

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.