Package org.hive2hive.core.model

Examples of org.hive2hive.core.model.FileVersion


    logger.debug("Adding a new version to the meta file.");

    // create a new version and add it to the meta file
    MetaFileSmall metaFileSmall = (MetaFileSmall) context.consumeMetaFile();
    newVersion = new FileVersion(metaFileSmall.getVersions().size(), FileUtil.getFileSize(context
        .getFile()), System.currentTimeMillis(), context.getMetaChunks());
    metaFileSmall.getVersions().add(newVersion);

    initiateCleanup();
  }
View Full Code Here


        .getBytes(), 1));
    List<MetaChunk> metaChunks2 = new ArrayList<MetaChunk>();
    metaChunks2.add(new MetaChunk(NetworkTestUtil.randomString(), NetworkTestUtil.randomString()
        .getBytes(), 2));
    List<FileVersion> fileVersions = new ArrayList<FileVersion>();
    fileVersions.add(new FileVersion(0, 123, System.currentTimeMillis(), metaChunks1));
    fileVersions.add(new FileVersion(1, 123, System.currentTimeMillis(), metaChunks2));
    MetaFileSmall metaFileSmall = new MetaFileSmall(metaFileEncryptionKeys.getPublic(), fileVersions,
        chunkEncryptionKeys);
    // encrypt the meta file
    HybridEncryptedContent encryptedMetaFile = H2HEncryptionUtil.encryptHybrid(metaFileSmall,
        metaFileEncryptionKeys.getPublic());
View Full Code Here

    MetaFile metaFile = null;
    if (context.isLargeFile()) {
      metaFile = new MetaFileLarge(context.generateOrGetMetaKeys().getPublic(), context.getMetaChunks());
    } else {
      // create new meta file with new version
      FileVersion version = new FileVersion(0, FileUtil.getFileSize(file), System.currentTimeMillis(),
          context.getMetaChunks());
      List<FileVersion> versions = new ArrayList<FileVersion>(1);
      versions.add(version);
      metaFile = new MetaFileSmall(context.generateOrGetMetaKeys().getPublic(), versions,
          context.consumeChunkKeys());
View Full Code Here

    if (selected == null) {
      throw new ProcessExecutionException("Selected file version is null.");
    }

    // find the selected version
    FileVersion selectedVersion = null;
    for (FileVersion version : metaFileSmall.getVersions()) {
      if (version.getIndex() == selected.getIndex()) {
        selectedVersion = version;
        break;
      }
View Full Code Here

TOP

Related Classes of org.hive2hive.core.model.FileVersion

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.