Search in sources :

Example 1 with DefaultStorageProviderConfiguration

use of org.commonjava.indy.filer.def.conf.DefaultStorageProviderConfiguration in project indy by Commonjava.

the class ProxyConfigProvider method getStorageProviderConfiguration.

@Produces
@TestData
@Default
public synchronized DefaultStorageProviderConfiguration getStorageProviderConfiguration() throws IOException {
    if (storageConfig == null) {
        final String path = System.getProperty(REPO_ROOT_DIR);
        File dir;
        if (path == null) {
            dir = File.createTempFile("repo.root", ".dir");
            dir.delete();
            dir.mkdirs();
        } else {
            dir = new File(path);
        }
        storageConfig = new DefaultStorageProviderConfiguration(dir);
    }
    return storageConfig;
}
Also used : DefaultStorageProviderConfiguration(org.commonjava.indy.filer.def.conf.DefaultStorageProviderConfiguration) File(java.io.File) TestData(org.commonjava.indy.inject.TestData) Produces(javax.enterprise.inject.Produces) Default(javax.enterprise.inject.Default)

Example 2 with DefaultStorageProviderConfiguration

use of org.commonjava.indy.filer.def.conf.DefaultStorageProviderConfiguration in project indy by Commonjava.

the class TestProvider method init.

@PostConstruct
public void init() {
    try {
        this.storageProviderConfig = new DefaultStorageProviderConfiguration(TEMP.newFolder("storage"));
        this.dataConfig = new DataFileConfiguration(TEMP.newFolder("data"), TEMP.newFolder("work"));
    } catch (final IOException e) {
        e.printStackTrace();
        Assert.fail("Failed to setup temporary directory structures: " + e.getMessage());
    }
    this.nfc = new MemoryNotFoundCache();
    this.xmlInfra = new XMLInfrastructure();
    this.typeMapper = new StandardTypeMapper();
    this.indyConfig = new DefaultIndyConfiguration();
    this.objectMapper = new IndyObjectMapper(true);
}
Also used : DefaultStorageProviderConfiguration(org.commonjava.indy.filer.def.conf.DefaultStorageProviderConfiguration) IndyObjectMapper(org.commonjava.indy.model.core.io.IndyObjectMapper) DataFileConfiguration(org.commonjava.indy.subsys.datafile.conf.DataFileConfiguration) XMLInfrastructure(org.commonjava.maven.galley.maven.parse.XMLInfrastructure) MemoryNotFoundCache(org.commonjava.maven.galley.nfc.MemoryNotFoundCache) IOException(java.io.IOException) StandardTypeMapper(org.commonjava.maven.galley.maven.internal.type.StandardTypeMapper) DefaultIndyConfiguration(org.commonjava.indy.conf.DefaultIndyConfiguration) PostConstruct(javax.annotation.PostConstruct)

Aggregations

DefaultStorageProviderConfiguration (org.commonjava.indy.filer.def.conf.DefaultStorageProviderConfiguration)2 File (java.io.File)1 IOException (java.io.IOException)1 PostConstruct (javax.annotation.PostConstruct)1 Default (javax.enterprise.inject.Default)1 Produces (javax.enterprise.inject.Produces)1 DefaultIndyConfiguration (org.commonjava.indy.conf.DefaultIndyConfiguration)1 TestData (org.commonjava.indy.inject.TestData)1 IndyObjectMapper (org.commonjava.indy.model.core.io.IndyObjectMapper)1 DataFileConfiguration (org.commonjava.indy.subsys.datafile.conf.DataFileConfiguration)1 StandardTypeMapper (org.commonjava.maven.galley.maven.internal.type.StandardTypeMapper)1 XMLInfrastructure (org.commonjava.maven.galley.maven.parse.XMLInfrastructure)1 MemoryNotFoundCache (org.commonjava.maven.galley.nfc.MemoryNotFoundCache)1