use of org.commonjava.maven.galley.transport.SimpleUrlLocationResolver in project galley by Commonjava.
the class GalleyCoreBuilder method initMissingComponents.
public void initMissingComponents() throws GalleyInitException {
if (transportManager == null) {
transportManager = new TransportManagerImpl(transports);
}
handlerExecutor = Executors.newFixedThreadPool(2, new NamedThreadFactory("transfer-handlers", true, 4));
batchExecutor = Executors.newFixedThreadPool(2, new NamedThreadFactory("transfer-batches", true, 4));
if (decorator == null) {
decorator = new NoOpTransferDecorator();
}
if (events == null) {
events = new NoOpFileEventManager();
}
if (nfc == null) {
nfc = new MemoryNotFoundCache();
}
if (transportManagerConfig == null) {
transportManagerConfig = new TransportManagerConfig();
}
final DownloadHandler dh = new DownloadHandler(getNfc(), transportManagerConfig, handlerExecutor);
final UploadHandler uh = new UploadHandler(getNfc(), transportManagerConfig, handlerExecutor);
final ListingHandler lh = new ListingHandler(getNfc());
final ExistenceHandler eh = new ExistenceHandler(getNfc());
if (specialPathManager == null) {
specialPathManager = new SpecialPathManagerImpl();
}
if (pathGenerator == null) {
pathGenerator = new HashedLocationPathGenerator();
}
if (cache == null) {
if (cacheProviderFactory != null) {
cache = cacheProviderFactory.create(pathGenerator, decorator, events);
} else {
throw new GalleyInitException("No CacheProvider / CacheProviderFactory specified!");
}
}
if (transferManager == null) {
transferManager = new TransferManagerImpl(transportManager, getCache(), getNfc(), getFileEvents(), dh, uh, lh, eh, specialPathManager, batchExecutor);
}
if (locationExpander == null) {
logger.debug("Initializing default location expander");
locationExpander = new NoOpLocationExpander();
}
if (locationResolver == null) {
locationResolver = new SimpleUrlLocationResolver(locationExpander, transportManager);
}
if (passwordManager == null) {
passwordManager = new MemoryPasswordManager();
}
}
use of org.commonjava.maven.galley.transport.SimpleUrlLocationResolver in project galley by Commonjava.
the class TestCDIProvider method start.
@PostConstruct
public void start() {
try {
temp.create();
cacheProvider = new PartyLineCacheProvider(temp.newFolder(), pathGenerator, eventManager, transferDecorator);
fileTransportConfig = new FileTransportConfig(temp.newFolder(), pathGenerator);
} catch (IOException e) {
Assert.fail("Failed to init temp folder fro file cache.");
}
locationExpander = new NoOpLocationExpander();
locationResolver = new SimpleUrlLocationResolver(locationExpander, transportManager);
globalHttpConfiguration = new GlobalHttpConfiguration();
weftConfig = new DefaultWeftConfig();
}
Aggregations