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;
}
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());
}
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;
}
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;
}
Aggregations