Package org.syncany.config.to.RepoTO

Examples of org.syncany.config.to.RepoTO.MultiChunkerTO


  public static MultiChunkerTO createZipMultiChunkerTO() {
    Map<String, String> settings = new HashMap<String, String>();
    settings.put(ZipMultiChunker.PROPERTY_SIZE, "4096");

    MultiChunkerTO multiChunkerTO = new MultiChunkerTO();
    multiChunkerTO.setType(ZipMultiChunker.TYPE);
    multiChunkerTO.setSettings(settings);

    return multiChunkerTO;
  }
View Full Code Here


    // Create Repo TO
    RepoTO repoTO = new RepoTO();
    repoTO.setRepoId(new byte[] { 0x01, 0x02, 0x03 });

    // Create ChunkerTO and MultiChunkerTO
    MultiChunkerTO multiChunkerTO = createZipMultiChunkerTO();
    ChunkerTO chunkerTO = createFixedChunkerTO();
    repoTO.setChunkerTO(chunkerTO); // TODO [low] Chunker not configurable right now. Not used.
    repoTO.setMultiChunker(multiChunkerTO);

    // Create TransformerTO
View Full Code Here

    chunker = new FixedChunker(512 * 1024, "SHA1");
  }

  private void initMultiChunker(RepoTO repoTO) throws ConfigException {
    MultiChunkerTO multiChunkerTO = repoTO.getMultiChunker();

    if (multiChunkerTO == null) {
      throw new ConfigException("No multichunker in repository config.");
    }

    multiChunker = MultiChunker.getInstance(multiChunkerTO.getType());

    if (multiChunker == null) {
      throw new ConfigException("Invalid multichunk type or settings: " + multiChunkerTO.getType());
    }

    multiChunker.init(multiChunkerTO.getSettings());
  }
View Full Code Here

    // Cipher specs: --no-encryption, --advanced
    List<CipherSpec> cipherSpecs = getCipherSpecs(encryptionEnabled, advancedModeEnabled);

    // Chunkers (not configurable)
    ChunkerTO chunkerTO = getDefaultChunkerTO();
    MultiChunkerTO multiChunkerTO = getDefaultMultiChunkerTO();

    // Compression: --no-compression
    List<TransformerTO> transformersTO = getTransformersTO(compressionEnabled, cipherSpecs);

    // Genlink options: --short
View Full Code Here

    return chunkerTO;
  }

  protected MultiChunkerTO getDefaultMultiChunkerTO() {
    MultiChunkerTO multichunkerTO = new MultiChunkerTO();

    multichunkerTO.setType(ZipMultiChunker.TYPE);
    multichunkerTO.setSettings(new HashMap<String, String>());
    multichunkerTO.getSettings().put(MultiChunker.PROPERTY_SIZE, "4096");

    return multichunkerTO;
  }
View Full Code Here

TOP

Related Classes of org.syncany.config.to.RepoTO.MultiChunkerTO

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.