Search in sources :

Example 1 with MimeTypeMapperImpl

use of ddf.mime.mapper.MimeTypeMapperImpl in project ddf by codice.

the class URLResourceReaderTest method setUp.

@Before
public void setUp() {
    MimeTypeResolver tikaResolver = new TikaMimeTypeResolver();
    this.customResolver = new CustomMimeTypeResolver();
    List<MimeTypeResolver> resolvers = new ArrayList<MimeTypeResolver>();
    resolvers.add(tikaResolver);
    resolvers.add(this.customResolver);
    this.mimeTypeMapper = new MimeTypeMapperImpl(resolvers);
    this.clientBuilderFactory = new ClientBuilderFactoryImpl();
}
Also used : TikaMimeTypeResolver(ddf.mime.tika.TikaMimeTypeResolver) MimeTypeResolver(ddf.mime.MimeTypeResolver) CustomMimeTypeResolver(ddf.mime.custom.CustomMimeTypeResolver) ClientBuilderFactoryImpl(org.codice.ddf.cxf.client.impl.ClientBuilderFactoryImpl) TikaMimeTypeResolver(ddf.mime.tika.TikaMimeTypeResolver) ArrayList(java.util.ArrayList) MimeTypeMapperImpl(ddf.mime.mapper.MimeTypeMapperImpl) CustomMimeTypeResolver(ddf.mime.custom.CustomMimeTypeResolver) Before(org.junit.Before)

Example 2 with MimeTypeMapperImpl

use of ddf.mime.mapper.MimeTypeMapperImpl in project ddf by codice.

the class ResourceOperationsOptionsTest method setUpFrameworkProperties.

private void setUpFrameworkProperties() {
    frameworkProperties = new FrameworkProperties();
    frameworkProperties.setAccessPlugins(new ArrayList<>());
    frameworkProperties.setPolicyPlugins(new ArrayList<>());
    frameworkProperties.setPostResource(mockPostResourcePlugins);
    frameworkProperties.setFederationStrategy(mockFederationStrategy);
    frameworkProperties.setFilterBuilder(new GeotoolsFilterBuilder());
    frameworkProperties.setPreIngest(new ArrayList<>());
    frameworkProperties.setPostIngest(postIngestPlugins);
    frameworkProperties.setPreQuery(new ArrayList<>());
    frameworkProperties.setPostQuery(new ArrayList<>());
    frameworkProperties.setPreResource(new ArrayList<>());
    frameworkProperties.setPostResource(new ArrayList<>());
    frameworkProperties.setQueryResponsePostProcessor(mock(QueryResponsePostProcessor.class));
    frameworkProperties.setStorageProviders(Collections.singletonList(storageProvider));
    frameworkProperties.setMimeTypeMapper(new MimeTypeMapperImpl(Collections.singletonList(mimeTypeResolver)));
    frameworkProperties.setMimeTypeToTransformerMapper(mimeTypeToTransformerMapper);
}
Also used : FrameworkProperties(ddf.catalog.impl.FrameworkProperties) GeotoolsFilterBuilder(ddf.catalog.filter.proxy.builder.GeotoolsFilterBuilder) MimeTypeMapperImpl(ddf.mime.mapper.MimeTypeMapperImpl) QueryResponsePostProcessor(ddf.catalog.impl.QueryResponsePostProcessor)

Example 3 with MimeTypeMapperImpl

use of ddf.mime.mapper.MimeTypeMapperImpl in project ddf by codice.

the class RemoteDeleteOperationsTest method setUpFrameworkProperties.

private void setUpFrameworkProperties() {
    frameworkProperties = new FrameworkProperties();
    frameworkProperties.setAccessPlugins(new ArrayList<>());
    frameworkProperties.setPolicyPlugins(new ArrayList<>());
    frameworkProperties.setCatalogProviders(Collections.singletonList((CatalogProvider) provider));
    frameworkProperties.setPostResource(mockPostResourcePlugins);
    frameworkProperties.setFederationStrategy(mockFederationStrategy);
    frameworkProperties.setFilterBuilder(new GeotoolsFilterBuilder());
    frameworkProperties.setPreIngest(new ArrayList<>());
    frameworkProperties.setPostIngest(postIngestPlugins);
    frameworkProperties.setPreQuery(new ArrayList<>());
    frameworkProperties.setPostQuery(new ArrayList<>());
    frameworkProperties.setPreResource(new ArrayList<>());
    frameworkProperties.setPostResource(new ArrayList<>());
    frameworkProperties.setQueryResponsePostProcessor(mock(QueryResponsePostProcessor.class));
    frameworkProperties.setStorageProviders(Collections.singletonList(storageProvider));
    frameworkProperties.setMimeTypeMapper(new MimeTypeMapperImpl(Collections.singletonList(mimeTypeResolver)));
    frameworkProperties.setMimeTypeToTransformerMapper(mimeTypeToTransformerMapper);
}
Also used : FrameworkProperties(ddf.catalog.impl.FrameworkProperties) CatalogProvider(ddf.catalog.source.CatalogProvider) GeotoolsFilterBuilder(ddf.catalog.filter.proxy.builder.GeotoolsFilterBuilder) MimeTypeMapperImpl(ddf.mime.mapper.MimeTypeMapperImpl) QueryResponsePostProcessor(ddf.catalog.impl.QueryResponsePostProcessor)

Example 4 with MimeTypeMapperImpl

use of ddf.mime.mapper.MimeTypeMapperImpl in project ddf by codice.

the class FileSystemStorageProviderTest method setUp.

@Before
public void setUp() throws IOException {
    baseDir = temporaryFolder.getRoot().getAbsolutePath();
    baseTmpDir = temporaryFolder.newFolder(FileSystemStorageProvider.DEFAULT_TMP).getAbsolutePath();
    String keysetHome = temporaryFolder.newFolder("keysets").getAbsolutePath();
    String associatedDataHome = temporaryFolder.newFolder("etc").getAbsolutePath();
    System.setProperty(SecurityConstants.KEYSET_DIR, keysetHome);
    System.setProperty(SecurityConstants.ASSOCIATED_DATA_PATH, associatedDataHome.concat("/associatedData.properties"));
    MimeTypeResolver resolver = new MockMimeTypeResolver();
    MimeTypeMapper mapper = new MimeTypeMapperImpl(Collections.singletonList(resolver));
    this.provider = new FileSystemStorageProvider();
    try {
        provider.setBaseContentDirectory(baseDir);
    } catch (IOException e) {
        fail(e.getMessage());
    }
    provider.setMimeTypeMapper(mapper);
}
Also used : MimeTypeResolver(ddf.mime.MimeTypeResolver) MimeTypeMapper(ddf.mime.MimeTypeMapper) MimeTypeMapperImpl(ddf.mime.mapper.MimeTypeMapperImpl) Matchers.isEmptyString(org.hamcrest.Matchers.isEmptyString) IOException(java.io.IOException) Before(org.junit.Before)

Example 5 with MimeTypeMapperImpl

use of ddf.mime.mapper.MimeTypeMapperImpl in project ddf by codice.

the class ResourceReaderTest method setUp.

@Before
public void setUp() {
    MimeTypeResolver tikaResolver = new TikaMimeTypeResolver();
    this.customResolver = new CustomMimeTypeResolver();
    List<MimeTypeResolver> resolvers = new ArrayList<MimeTypeResolver>();
    resolvers.add(tikaResolver);
    resolvers.add(this.customResolver);
    this.mimeTypeMapper = new MimeTypeMapperImpl(resolvers);
}
Also used : TikaMimeTypeResolver(ddf.mime.tika.TikaMimeTypeResolver) MimeTypeResolver(ddf.mime.MimeTypeResolver) CustomMimeTypeResolver(ddf.mime.custom.CustomMimeTypeResolver) TikaMimeTypeResolver(ddf.mime.tika.TikaMimeTypeResolver) ArrayList(java.util.ArrayList) MimeTypeMapperImpl(ddf.mime.mapper.MimeTypeMapperImpl) CustomMimeTypeResolver(ddf.mime.custom.CustomMimeTypeResolver) Before(org.junit.Before)

Aggregations

MimeTypeMapperImpl (ddf.mime.mapper.MimeTypeMapperImpl)7 GeotoolsFilterBuilder (ddf.catalog.filter.proxy.builder.GeotoolsFilterBuilder)4 MimeTypeResolver (ddf.mime.MimeTypeResolver)4 Before (org.junit.Before)4 FrameworkProperties (ddf.catalog.impl.FrameworkProperties)3 QueryResponsePostProcessor (ddf.catalog.impl.QueryResponsePostProcessor)3 ArrayList (java.util.ArrayList)3 CatalogProvider (ddf.catalog.source.CatalogProvider)2 ByteSource (com.google.common.io.ByteSource)1 ActionRegistry (ddf.action.ActionRegistry)1 MockMemoryStorageProvider (ddf.catalog.content.impl.MockMemoryStorageProvider)1 Metacard (ddf.catalog.data.Metacard)1 Result (ddf.catalog.data.Result)1 DefaultAttributeValueRegistryImpl (ddf.catalog.data.defaultvalues.DefaultAttributeValueRegistryImpl)1 AttributeRegistryImpl (ddf.catalog.data.impl.AttributeRegistryImpl)1 MetacardImpl (ddf.catalog.data.impl.MetacardImpl)1 AttributeInjectorImpl (ddf.catalog.data.inject.AttributeInjectorImpl)1 FederationStrategy (ddf.catalog.federation.FederationStrategy)1 Historian (ddf.catalog.history.Historian)1 CreateOperations (ddf.catalog.impl.operations.CreateOperations)1