Package org.exoplatform.services.jcr.ext.backup.impl

Examples of org.exoplatform.services.jcr.ext.backup.impl.FileNameProducer


   }

   @Override
   protected URL createStorage() throws FileNotFoundException, IOException
   {
      FileNameProducer fnp =
         new FileNameProducer(config.getRepository(), config.getWorkspace(),
            PrivilegedFileHelper.getAbsolutePath(config.getBackupDir()), super.timeStamp, false);

      File backupFileData = fnp.getNextFile();

      oosFileData = new ObjectOutputStream(PrivilegedFileHelper.fileOutputStream(backupFileData));

      return new URL("file:" + backupFileData.getAbsoluteFile());
   }
View Full Code Here


   }

   @Override
   protected URL createStorage() throws FileNotFoundException, IOException
   {
      FileNameProducer fnp =
         new FileNameProducer(config.getRepository(), config.getWorkspace(),
config.getBackupDir()
                        .getAbsolutePath(), super.timeStamp, false);

      File backupFileData = fnp.getNextFile();

      oosFileData = new ObjectOutputStream(new FileOutputStream(backupFileData));
      return new URL("file:" + backupFileData.getAbsoluteFile());
   }
View Full Code Here

   @Override
   protected URL createStorage() throws FileNotFoundException, IOException
   {

      FileNameProducer fnp =
         new FileNameProducer(config.getRepository(), config.getWorkspace(),
            config.getBackupDir().getAbsolutePath(), super.timeStamp, true);

      return new URL("file:" + fnp.getNextFile().getAbsolutePath());
   }
View Full Code Here

   }

   @Override
   protected URL createStorage() throws FileNotFoundException, IOException
   {
      FileNameProducer fnp =
         new FileNameProducer(config.getRepository(), config.getWorkspace(),
            PrivilegedFileHelper.getAbsolutePath(config.getBackupDir()), super.timeStamp, false);

      File backupFileData = fnp.getNextFile();

      oosFileData = new ObjectOutputStream(PrivilegedFileHelper.fileOutputStream(backupFileData));

      return new URL("file:" + backupFileData.getAbsoluteFile());
   }
View Full Code Here

    * {@inheritDoc}
    */
   @Override
   protected URL createStorage() throws FileNotFoundException, IOException
   {
      FileNameProducer fnp =
         new FileNameProducer(config.getRepository(), config.getWorkspace(),
            PrivilegedFileHelper.getAbsolutePath(config.getBackupDir()), super.timeStamp, true, true);

      return new URL("file:" + PrivilegedFileHelper.getAbsolutePath(fnp.getNextFile()));
   }
View Full Code Here

   }

   @Override
   protected URL createStorage() throws FileNotFoundException, IOException
   {
      FileNameProducer fnp =
         new FileNameProducer(config.getRepository(), config.getWorkspace(),
            PrivilegedFileHelper.getAbsolutePath(config.getBackupDir()), super.timeStamp, false);

      File backupFileData = fnp.getNextFile();

      oosFileData = new ObjectOutputStream(PrivilegedFileHelper.fileOutputStream(backupFileData));
      return new URL("file:" + backupFileData.getAbsoluteFile());
   }
View Full Code Here

   @Override
   protected URL createStorage() throws FileNotFoundException, IOException
   {

      FileNameProducer fnp =
         new FileNameProducer(config.getRepository(), config.getWorkspace(),
            PrivilegedFileHelper.getAbsolutePath(config.getBackupDir()), super.timeStamp, true);

      return new URL("file:" + PrivilegedFileHelper.getAbsolutePath(fnp.getNextFile()));
   }
View Full Code Here

    * {@inheritDoc}
    */
   @Override
   protected URL createStorage() throws FileNotFoundException, IOException
   {
      FileNameProducer fnp =
         new FileNameProducer(config.getRepository(), config.getWorkspace(),
            PrivilegedFileHelper.getAbsolutePath(config.getBackupDir()), super.timeStamp, true, true);

      return new URL("file:" + PrivilegedFileHelper.getAbsolutePath(fnp.getNextFile()));
   }
View Full Code Here

   }

   @Override
   protected URL createStorage() throws FileNotFoundException, IOException
   {
      FileNameProducer fnp =
         new FileNameProducer(config.getRepository(), config.getWorkspace(),
            PrivilegedFileHelper.getAbsolutePath(config.getBackupDir()), super.timeStamp, false);

      File backupFileData = fnp.getNextFile();

      oosFileData = new ObjectOutputStream(PrivilegedFileHelper.fileOutputStream(backupFileData));

      return new URL("file:" + backupFileData.getAbsoluteFile());
   }
View Full Code Here

   public void testGetNextNameJCRBackup() throws Exception
   {
      tempDir = new File("target" + File.separator + "temp" + File.separator + "fileProduser1");
      tempDir.mkdirs();

      FileNameProducer nameProducer =
         new FileNameProducer(backupsetName, tempDir.getAbsolutePath(), calendar, true, false);
      File file = nameProducer.getNextFile();

      assertTrue(file.isFile());
      assertTrue(file.getName().endsWith(".0"));

      nameProducer = new FileNameProducer(backupsetName, tempDir.getAbsolutePath(), calendar, false, false);
      file = nameProducer.getNextFile();

      assertTrue(file.isFile());
      assertTrue(file.getName().endsWith(".1"));
      assertTrue(nameProducer.getNextFile().getName().endsWith(".2"));
      assertTrue(nameProducer.getNextFile().getName().endsWith(".3"));
   }
View Full Code Here

TOP

Related Classes of org.exoplatform.services.jcr.ext.backup.impl.FileNameProducer

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.