Package org.exoplatform.services.jcr.impl.util.io

Examples of org.exoplatform.services.jcr.impl.util.io.FileCleaner


      this.registryService = registryService;
      this.initParams = initParams;

      currentBackups = Collections.synchronizedSet(new HashSet<BackupChain>());

      fileCleaner = new FileCleaner(10000);

      messages = new BackupMessagesLog(MESSAGES_MAXSIZE);

      scheduler = new BackupScheduler(this, messages);
View Full Code Here


            RepositoryException
   {
      super(config, repConfig, dataManager, namespaceRegistry, locationFactory, nodeTypeManager, valueFactory,
               accessManager);

      this.fileCleaner = new FileCleaner();

      restoreDir = restorePath;

      String fullBackupPath = getFullBackupPath();
View Full Code Here

      this.dataManager = dataManager;

      this.namespaceRegistry = namespaceRegistry;
      this.locationFactory = locationFactory;

      this.fileCleaner = new FileCleaner(false); // cleaner should be started!
      this.maxBufferSize =
         config.getContainer().getParameterInteger(WorkspaceDataContainer.MAXBUFFERSIZE_PROP,
            WorkspaceDataContainer.DEF_MAXBUFFERSIZE);

      this.restorePath =
View Full Code Here

      this.dataManager = dataManager;

      this.namespaceRegistry = namespaceRegistry;
      this.locationFactory = locationFactory;

      this.fileCleaner = new FileCleaner(false); // cleaner should be started!
      this.maxBufferSize =
         config.getContainer().getParameterInteger(WorkspaceDataContainer.MAXBUFFERSIZE_PROP,
            WorkspaceDataContainer.DEF_MAXBUFFERSIZE);
      this.restorePath = restorePath;
   }
View Full Code Here

      assertTrue(vd.getAsStream() instanceof FileInputStream);
   }

   public void testIfFinalizeRemovesTempFileStreamValueData() throws Exception
   {
      FileCleaner testFileCleaner = new FileCleaner(1000, true);
      try
      {
         byte[] buf = "0123456789".getBytes();
         SwapFile file = SwapFile.get(new File("target"), "testIfFinalizeRemovesTempFileStreamValueData");
         //File file = new File("target/testIfFinalizeRemovesTempFileStreamValueData");
         //if (file.exists())
         //  file.delete();
         FileOutputStream out = new FileOutputStream(file);
         out.write(buf);
         out.close();

         CleanableFilePersistedValueData vd =
            new CleanableFilePersistedValueData(0, file, SpoolConfig.getDefaultSpoolConfig());
         assertTrue(file.exists());

         vd = null;

         long purgeStartTime = System.currentTimeMillis();
         while (file.exists() && (System.currentTimeMillis() - purgeStartTime < 2 * 60 * 1000))
         {
            System.gc();
            try
            {
               Thread.sleep(500);
            }
            catch (InterruptedException e)
            {
            }
         }

         assertFalse(file.exists());
      }
      finally
      {
         testFileCleaner.halt();
      }
   }
View Full Code Here

   public void setUp() throws Exception
   {
      super.setUp();

      testFile = new File(parentDir, FILE_NAME);
      testCleaner = new FileCleaner(CLEANER_TIMEOUT);

      SwapFile sf = SwapFile.get(parentDir, FILE_NAME);
      FileOutputStream fout = new FileOutputStream(sf);
      fout.write("testFileCleaned".getBytes());
      fout.close();
View Full Code Here

TOP

Related Classes of org.exoplatform.services.jcr.impl.util.io.FileCleaner

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.