use of org.syncany.plugins.transfer.TransferManagerFactory.TransferManagerBuilder in project syncany by syncany.
the class AbstractInitOperation method createTransferManagerFromNullConfig.
protected TransferManager createTransferManagerFromNullConfig(ConfigTO configTo) throws IllegalAccessException, InvocationTargetException, InstantiationException, NoSuchMethodException, StorageException {
// Init plugin and transfer manager
TransferPlugin plugin = Plugins.get(configTo.getTransferSettings().getType(), TransferPlugin.class);
TransferSettings transferSettings = configTo.getTransferSettings();
transferSettings.setUserInteractionListener(listener);
TransferManager transferManager = plugin.createTransferManager(transferSettings, config);
// constructor is not visible and config seems to be null at this point, hence we cannot use the build method here
Constructor<TransferManagerBuilder> tmbConstructor = TransferManagerBuilder.class.getDeclaredConstructor(Config.class, TransferManager.class);
tmbConstructor.setAccessible(true);
return tmbConstructor.newInstance(config, transferManager).withFeature(ReadAfterWriteConsistent.class).asDefault();
}
Aggregations