Package org.exoplatform.services.jcr.impl.dataflow.serialization

Examples of org.exoplatform.services.jcr.impl.dataflow.serialization.ObjectReaderImpl


      wr.close();

      vd = null;

      // read first time
      ObjectReader or = new ObjectReaderImpl(new FileInputStream(serf));

      FilePersistedValueData vd1 = null;

      PersistedValueDataReader vdr = new PersistedValueDataReader(fileCleaner, maxBufferSize, holder);
      try
      {
         vd1 = (FilePersistedValueData)vdr.read(or);
      }
      catch (UnknownClassIdException e)
      {
         fail(e.getMessage());
      }

      or.close();
      // Imitation save
      ((StreamPersistedValueData) vd1).setPersistedFile(((StreamPersistedValueData) vd1).getTempFile());

      // read second time
      or = new ObjectReaderImpl(new FileInputStream(serf));
      FilePersistedValueData vd2 = null;

      try
      {
         vd2 = (FilePersistedValueData)vdr.read(or);
      }
      catch (UnknownClassIdException e)
      {
         fail(e.getMessage());
      }
      or.close();
      // Imitation save
      ((StreamPersistedValueData) vd2).setPersistedFile(((StreamPersistedValueData) vd2).getTempFile());

      assertTrue(vd1.getFile().exists());
      assertTrue(vd2.getFile().exists());
View Full Code Here


         {
            jdbcConn = (Connection) context.getObject(DataRestoreContext.DB_CONNECTION);
         }

         backupInfo =
                  new ObjectReaderImpl(PrivilegedFileHelper.fileInputStream(new File(storageDir,
               "JDBCWorkspaceDataContainer.info")));

         String srcContainerName = backupInfo.readString();
         boolean srcMultiDb = backupInfo.readBoolean();
View Full Code Here

    *           will be generated the ClassNotFoundException
    */
   public TransactionChangesLog getChangesLog(String filePath) throws IOException, ClassNotFoundException
   {

      ObjectReaderImpl in = new ObjectReaderImpl(new FileInputStream(filePath));
      TransactionChangesLogReader rdr = new TransactionChangesLogReader(fileCleaner, maxBufferSize, holder);

      TransactionChangesLog tcl;
      try
      {
         tcl = rdr.read(in);
      }
      catch (UnknownClassIdException e)
      {
         throw new ClassNotFoundException(e.getMessage(), e);
      }
      in.close();
      return tcl;
   }
View Full Code Here

      {
         this.dstDbType = containerConfig.dbStructureType;
         this.dstContainerName = containerConfig.containerName;

         backupInfoReader =
            new ObjectReaderImpl(PrivilegedFileHelper.fileInputStream(new File(storageDir,
               "JDBCWorkspaceDataContainer.info")));;

         this.srcContainerName = backupInfoReader.readString();
         this.srcDbType = DatabaseStructureType.valueOf(backupInfoReader.readString());
         this.srcItemTableName = backupInfoReader.readString();
View Full Code Here

      ObjectReader backupInfo = null;
      try
      {
         backupInfo =
            new ObjectReaderImpl(PrivilegedFileHelper.fileInputStream(new File(storageDir,
               "JDBCWorkspaceDataContainer.info")));

         String srcContainerName = backupInfo.readString();
         boolean srcMultiDb = backupInfo.readBoolean();
View Full Code Here

      wr.close();

      vd = null;

      // read first time
      ObjectReader or = new ObjectReaderImpl(new FileInputStream(serf));

      FilePersistedValueData vd1 = null;

      PersistedValueDataReader vdr = new PersistedValueDataReader(holder, SpoolConfig.getDefaultSpoolConfig());
      try
      {
         vd1 = (FilePersistedValueData)vdr.read(or, PropertyType.BINARY);
      }
      catch (UnknownClassIdException e)
      {
         fail(e.getMessage());
      }

      or.close();
      // Imitation save
      ((StreamPersistedValueData) vd1).setPersistedFile(((StreamPersistedValueData) vd1).getTempFile());

      // read second time
      or = new ObjectReaderImpl(new FileInputStream(serf));
      FilePersistedValueData vd2 = null;

      try
      {
         vd2 = (FilePersistedValueData)vdr.read(or, PropertyType.BINARY);
      }
      catch (UnknownClassIdException e)
      {
         fail(e.getMessage());
      }
      or.close();
      // Imitation save
      ((StreamPersistedValueData) vd2).setPersistedFile(((StreamPersistedValueData) vd2).getTempFile());

      assertTrue(vd1.getFile().exists());
      assertTrue(vd2.getFile().exists());
View Full Code Here

      long start = System.currentTimeMillis();

      InputStream in = new FileInputStream(srcSerialization);
      OutputStream out = new FileOutputStream(dest);

      ObjectReader or = new ObjectReaderImpl(in);
      ObjectWriter ow = new ObjectWriterImpl(out);

      for (int i = 0; i < BLOCK_COUNT; i++)
      {
         ow.writeInt(or.readInt());
         ow.writeInt(or.readInt());
         ow.writeInt(or.readInt());
         ow.writeLong(or.readLong());
         ow.writeLong(or.readLong());
         ow.writeLong(or.readLong());
         ow.writeString(or.readString());
         ow.writeString(or.readString());
         or.readFully(buf);
         ow.write(buf);
      }

      in.close();
      out.flush();
View Full Code Here

         {
            jdbcConn = (Connection) context.getObject(DataRestoreContext.DB_CONNECTION);
         }

         backupInfo =
                  new ObjectReaderImpl(PrivilegedFileHelper.fileInputStream(new File(storageDir,
               "JDBCWorkspaceDataContainer.info")));

         String srcContainerName = backupInfo.readString();
         boolean srcMultiDb = backupInfo.readBoolean();
View Full Code Here

         {
            jdbcConn = (Connection)context.getObject(DataRestoreContext.DB_CONNECTION);
         }

         backupInfo =
            new ObjectReaderImpl(PrivilegedFileHelper.fileInputStream(new File(storageDir,
               "JDBCWorkspaceDataContainer.info")));

         String srcContainerName = backupInfo.readString();
         boolean srcMultiDb = backupInfo.readBoolean();
View Full Code Here

         {
            jdbcConn = (Connection) context.getObject(DataRestoreContext.DB_CONNECTION);
         }

         backupInfo =
                  new ObjectReaderImpl(PrivilegedFileHelper.fileInputStream(new File(storageDir,
               "JDBCWorkspaceDataContainer.info")));

         String srcContainerName = backupInfo.readString();
         boolean srcMultiDb = backupInfo.readBoolean();
View Full Code Here

TOP

Related Classes of org.exoplatform.services.jcr.impl.dataflow.serialization.ObjectReaderImpl

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.