Examples of StreamPersistedValueData


Examples of org.exoplatform.services.jcr.impl.dataflow.persistent.StreamPersistedValueData

      ByteArrayInputStream bin;

      for (int i = 0; i < nodes; i++)
      {
         bin = new ByteArrayInputStream(createBLOBTempData(20));
         list.add(new StreamPersistedValueData(0, bin));
      }

      Iterator<AbstractPersistedValueData> it;
      // Serialize with JCR
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.dataflow.persistent.StreamPersistedValueData

   protected void write(String digestType) throws Exception
   {
      FileIOChannel fch = openCASChannel(digestType);

      String propertyId = IdGenerator.generate();
      ValueData value = new StreamPersistedValueData(0, new FileInputStream(testFile));

      fch.write(propertyId, value);
      fch.commit();

      File vsfile =
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.dataflow.persistent.StreamPersistedValueData

   {
      FileIOChannel fch = openCASChannel(digestType);

      // prepare
      String propertyId = IdGenerator.generate();
      ValueData value = new StreamPersistedValueData(0, new FileInputStream(testFile));
      fch.write(propertyId, value);
      fch.commit();

      long initialSize = calcDirSize(rootDir);

      try
      {
         fch = openCASChannel(digestType);
         fch.write(new String(propertyId), new StreamPersistedValueData(0, new FileInputStream(testFile)));
         fch.commit();

         fail("RecordAlreadyExistsException should be thrown, record exists");
      }
      catch (RecordAlreadyExistsException e)
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.dataflow.persistent.StreamPersistedValueData

      // prepare
      String propertyId = IdGenerator.generate();
      try
      {
         ValueData value = new StreamPersistedValueData(0, new FileInputStream(testFile));
         fch.write(propertyId, value);
         fch.delete(propertyId);
         fch.write(propertyId, new StreamPersistedValueData(0, new FileInputStream(testFile)));
         fch.commit();

         // long initialSize = calcDirSize(rootDir);
      }
      catch (RecordAlreadyExistsException e)
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.dataflow.persistent.StreamPersistedValueData

   protected void writeRead(String digestType) throws Exception
   {
      FileIOChannel fch = openCASChannel(digestType);

      String propertyId = IdGenerator.generate();
      ValueData value = new StreamPersistedValueData(0, new FileInputStream(testFile));
      fch.write(propertyId, value);
      fch.commit();

      ValueData fvalue = fch.read(propertyId, value.getOrderNumber(), 200 * 1024);

      InputStream etalon, tested;
      compareStream(etalon = new FileInputStream(testFile), tested = fvalue.getAsStream());
      etalon.close();
      tested.close();
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.dataflow.persistent.StreamPersistedValueData

   protected void writeDelete(String digestType) throws Exception
   {
      FileIOChannel fch = openCASChannel(digestType);

      String propertyId = IdGenerator.generate();
      ValueData value = new StreamPersistedValueData(0, new FileInputStream(testFile));
      fch.write(propertyId, value);
      fch.commit();

      File vsfile =
         new File(rootDir, fch.makeFilePath(vcas.getIdentifier(propertyId, 0), CASableIOSupport.HASHFILE_ORDERNUMBER)); // orderNum
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.dataflow.persistent.StreamPersistedValueData

      long initialSize = calcDirSize(rootDir);

      for (int i = 0; i < 20; i++)
      {
         fch.write(propertyId, new StreamPersistedValueData(i, new FileInputStream(testFile)));
      }
      fch.commit();

      File vsfile =
         new File(rootDir, fch.makeFilePath(vcas.getIdentifier(propertyId, 15), CASableIOSupport.HASHFILE_ORDERNUMBER));
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.dataflow.persistent.StreamPersistedValueData

      long addedSize = 0;
      for (int i = 0; i < 20; i++)
      {
         File f = createBLOBTempFile(300);
         addedSize += f.length();
         fch.write(propertyId, new StreamPersistedValueData(i, new FileInputStream(f)));
      }
      fch.commit();

      File vsfile =
         new File(rootDir, fch.makeFilePath(vcas.getIdentifier(propertyId, 15), CASableIOSupport.HASHFILE_ORDERNUMBER));
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.dataflow.persistent.StreamPersistedValueData

      for (int i = 0; i < count; i++)
      {
         propertyId = IdGenerator.generate();

         FileIOChannel fch = openCASChannel(digestType);
         fch.write(propertyId, new StreamPersistedValueData(0, new FileInputStream(testFile)));
         fch.commit();
      }

      assertEquals("Storage size must be increased on size of ONE file ", initialSize + testFile.length(),
         calcDirSize(rootDir));
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.dataflow.persistent.StreamPersistedValueData

         File f = createBLOBTempFile(300);
         addedSize += f.length();

         FileIOChannel fch = openCASChannel(digestType);
         fch.write(propertyId, new StreamPersistedValueData(i, new FileInputStream(f)));
         fch.commit();
      }

      assertEquals("Storage size must be increased on size of ALL files ", initialSize + addedSize,
         calcDirSize(rootDir));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.