Search in sources :

Example 1 with MultiChunkerTO

use of org.syncany.config.to.RepoTO.MultiChunkerTO in project syncany by syncany.

the class DefaultRepoTOFactory method getDefaultMultiChunkerTO.

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;
}
Also used : MultiChunkerTO(org.syncany.config.to.RepoTO.MultiChunkerTO)

Example 2 with MultiChunkerTO

use of org.syncany.config.to.RepoTO.MultiChunkerTO in project syncany by syncany.

the class Config method initMultiChunker.

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());
}
Also used : MultiChunkerTO(org.syncany.config.to.RepoTO.MultiChunkerTO)

Example 3 with MultiChunkerTO

use of org.syncany.config.to.RepoTO.MultiChunkerTO in project syncany by syncany.

the class TestConfigUtil method createRepoTO.

public static RepoTO createRepoTO() {
    // Create Repo TO
    RepoTO repoTO = new RepoTO();
    repoTO.setRepoId(new byte[] { 0x01, 0x02, 0x03 });
    // Create ChunkerTO and MultiChunkerTO
    MultiChunkerTO multiChunkerTO = createZipMultiChunkerTO();
    ChunkerTO chunkerTO = createFixedChunkerTO();
    // TODO [low] Chunker not configurable right now. Not used.
    repoTO.setChunkerTO(chunkerTO);
    repoTO.setMultiChunker(multiChunkerTO);
    // Create TransformerTO
    List<TransformerTO> transformerTOs = createTransformerTOs();
    repoTO.setTransformers(transformerTOs);
    return repoTO;
}
Also used : ChunkerTO(org.syncany.config.to.RepoTO.ChunkerTO) MultiChunkerTO(org.syncany.config.to.RepoTO.MultiChunkerTO) MultiChunkerTO(org.syncany.config.to.RepoTO.MultiChunkerTO) TransformerTO(org.syncany.config.to.RepoTO.TransformerTO) RepoTO(org.syncany.config.to.RepoTO)

Example 4 with MultiChunkerTO

use of org.syncany.config.to.RepoTO.MultiChunkerTO in project syncany by syncany.

the class TestConfigUtil method createZipMultiChunkerTO.

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;
}
Also used : MultiChunkerTO(org.syncany.config.to.RepoTO.MultiChunkerTO) HashMap(java.util.HashMap)

Aggregations

MultiChunkerTO (org.syncany.config.to.RepoTO.MultiChunkerTO)4 HashMap (java.util.HashMap)1 RepoTO (org.syncany.config.to.RepoTO)1 ChunkerTO (org.syncany.config.to.RepoTO.ChunkerTO)1 TransformerTO (org.syncany.config.to.RepoTO.TransformerTO)1