Package org.jboss.virtual.spi

Examples of org.jboss.virtual.spi.TempStore


         if (fileHandler.equals(contextHandler))
         {
            VFSRegistry registry = VFSRegistry.getInstance();
            registry.removeContext(context);

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


               vfs = VFS.getVFS(url);
               log.debug("Initialized Virtual File: " + vfs.getRoot());
               refs.put(url, vfs);
            }

            TempStore ts = entry.getValue();
            if (ts != null)
               vfs.setTempStore(ts);
         }
      }
View Full Code Here

      // old vfs context
      VFSContext oldVFSContext = handler.getVFSContext();

      //create guid dir
      File guidDir = null;
      TempStore store = oldVFSContext.getTempStore();
      if (store != null)
         guidDir = store.createTempFolder(file);

      if (guidDir == null)
         guidDir = createTempDirectory(getTempDirectory(), GUID.asString());
     
      // unpack handler
View Full Code Here

                  if (createNewTempInfo)
                  {
                     // extract it to temp dir
                     String tempName = getTempFileName(entryName);
                     TempStore store = (context != null) ? context.getTempStore() : null;
                     if (store != null)
                     {
                        File tempDir = store.createTempFolder(zipSource.getName(), ent.getName());
                        if (tempDir != null)
                           dest = new File(tempDir, tempName);
                     }
                     if (dest == null)
                        dest = new File(getTempDir() + "/" + tempName);
View Full Code Here

   }

   public void cleanup()
   {
      cleanupTempInfo(""); // clear from root
      TempStore store = getTempStore();
      if (store != null)
         store.clear();
   }
View Full Code Here

   public void testCopyMechanism() throws Throwable
   {
      long seed = System.nanoTime();
      URL url = getResource("/vfs/test");
      VFS vfs = VFS.getVFS(url);
      TempStore store = new MkdirTempStore(new DeleteOnExitTempStore(new MockTempStore(seed)));
      vfs.setTempStore(store);
      VirtualFile file = vfs.getChild("jar1.jar");
      VirtualFile temp = VFSUtils.explode(file);
      try
      {
View Full Code Here

   {
      long seed = System.nanoTime();
      URL url = getResource("/vfs/test/nested");
      VFS vfs = VFS.getVFS(url);
      VFSUtils.enableCopy(vfs);
      TempStore store = new MkdirTempStore(new TrackingTempStore(new MockTempStore(seed)));
      try
      {
         vfs.setTempStore(store);
         VirtualFile file = vfs.getChild("nested.jar");
         assertNotNull(file.getChild("complex.jar/subfolder/subchild"));
         try
         {
            File tempRoot = AbstractCopyMechanism.getTempDirectory();
            File test = new File(tempRoot, "complex.jar" + '_' + seed);
            assertTrue(test.exists()); // should be created by MockTS
         }
         finally
         {
            file.cleanup();
         }
      }
      finally
      {
         store.clear();
      }
   }
View Full Code Here

TOP

Related Classes of org.jboss.virtual.spi.TempStore

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.