use of org.commonjava.maven.galley.cache.FileCacheProviderFactory in project galley by Commonjava.
the class CoreFixture method initGalley.
public void initGalley() throws IOException {
temp.create();
if (cacheDir == null) {
cacheDir = temp.newFolder("cache");
}
coreBuilder = new GalleyCoreBuilder(new FileCacheProviderFactory(cacheDir));
}
use of org.commonjava.maven.galley.cache.FileCacheProviderFactory in project indy by Commonjava.
the class ArtifactStoreValidatorTest method setup.
@Before
public void setup() throws Exception {
cacheDir = temp.newFolder();
galley = new GalleyCoreBuilder(new FileCacheProviderFactory(cacheDir)).withEnabledTransports(new HttpClientTransport(new HttpImpl(new MemoryPasswordManager()))).build();
validator = new ArtifactStoreValidator(galley.getTransferManager());
}
use of org.commonjava.maven.galley.cache.FileCacheProviderFactory in project indy by Commonjava.
the class KojiMavenMetadataProviderTest method initKojiClient.
private void initKojiClient(String exchangeName, boolean verifyArtifacts) throws BindException, IOException, GalleyInitException, IndyDataException {
StoreDataManager storeDataManager = new MemoryStoreDataManager(true);
if (verifyArtifacts) {
RemoteRepository verifyRepo = new RemoteRepository(MAVEN_PKG_KEY, VERIFY_REPO, server.formatUrl(VERIFY_BASEPATH));
storeDataManager.storeArtifactStore(verifyRepo, new ChangeSummary(ChangeSummary.SYSTEM_USER, "Adding verification repo"), false, true, new EventMetadata());
kojiConfig.setArtifactAuthorityStore(new StoreKey(MAVEN_PKG_KEY, remote, VERIFY_REPO).toString());
}
String resourceBase = "koji-metadata/" + exchangeName;
configureKojiServer(server, KOJI_BASEPATH, counter, resourceBase, verifyArtifacts, VERIFY_BASEPATH);
kojiClient = new KojiClient(kojiConfig, new MemoryPasswordManager(), Executors.newCachedThreadPool());
GalleyCore galley = new GalleyCoreBuilder(new FileCacheProviderFactory(temp.newFolder("cache"))).withEnabledTransports(new HttpClientTransport(new HttpImpl(new org.commonjava.maven.galley.auth.MemoryPasswordManager()), new IndyObjectMapper(true), new GlobalHttpConfiguration())).build();
DownloadManager downloadManager = new DefaultDownloadManager(storeDataManager, galley.getTransferManager(), new IndyLocationExpander(storeDataManager));
DirectContentAccess directContentAccess = new DefaultDirectContentAccess(downloadManager, Executors.newCachedThreadPool());
DirectContentAccess dca = new DefaultDirectContentAccess(downloadManager, Executors.newSingleThreadExecutor());
ContentDigester contentDigester = new DefaultContentDigester(dca, new CacheHandle<String, TransferMetadata>("content-metadata", contentMetadata));
KojiBuildAuthority buildAuthority = new KojiBuildAuthority(kojiConfig, new StandardTypeMapper(), kojiClient, storeDataManager, contentDigester, directContentAccess);
provider = new KojiMavenMetadataProvider(this.cache, kojiClient, buildAuthority, kojiConfig);
}
use of org.commonjava.maven.galley.cache.FileCacheProviderFactory in project indy by Commonjava.
the class DefaultDownloadManagerTest method setup.
@Before
public void setup() throws IOException, GalleyInitException {
core = new GalleyCoreBuilder(new FileCacheProviderFactory(temp.newFolder("cache"))).build();
storeManager = new MemoryStoreDataManager(true);
LocationExpander locationExpander = new IndyLocationExpander(storeManager);
downloadManager = new DefaultDownloadManager(storeManager, core.getTransferManager(), locationExpander);
}
use of org.commonjava.maven.galley.cache.FileCacheProviderFactory in project galley by Commonjava.
the class GalleyMavenFixture method initGalley.
public void initGalley() throws IOException {
if (temp == null) {
temp = new TemporaryFolder();
}
temp.create();
if (cacheDir == null) {
cacheDir = temp.newFolder("cache");
}
mavenBuilder = new GalleyMavenBuilder();
mavenBuilder.withCacheProviderFactory(new FileCacheProviderFactory(cacheDir));
}
Aggregations