Search in sources :

Example 11 with MimeTypeMapper

use of ddf.mime.MimeTypeMapper in project ddf by codice.

the class MimeTypeMapperTest method testMultipleResolvers.

@Test
public void testMultipleResolvers() throws Exception {
    MimeTypeMapper mapper = new MimeTypeMapperImpl(MOCK_MIME_TYPE_RESOLVERS);
    String fileExtension = mapper.getFileExtensionForMimeType("image/nitf");
    LOGGER.debug("fileExtension = {}", fileExtension);
    assertEquals(".nitf", fileExtension);
}
Also used : MimeTypeMapper(ddf.mime.MimeTypeMapper) Test(org.junit.Test)

Example 12 with MimeTypeMapper

use of ddf.mime.MimeTypeMapper in project ddf by codice.

the class MimeTypeMapperTest method testSingleResolver.

@Test
public void testSingleResolver() throws Exception {
    MimeTypeMapper mapper = new MimeTypeMapperImpl(MOCK_MIME_TYPE_RESOLVERS);
    String fileExtension = mapper.getFileExtensionForMimeType("image/nitf");
    LOGGER.debug("fileExtension = {}", fileExtension);
    assertEquals(".nitf", fileExtension);
}
Also used : MimeTypeMapper(ddf.mime.MimeTypeMapper) Test(org.junit.Test)

Aggregations

MimeTypeMapper (ddf.mime.MimeTypeMapper)12 Test (org.junit.Test)10 InputStream (java.io.InputStream)4 MetacardImpl (ddf.catalog.data.impl.MetacardImpl)3 InputTransformer (ddf.catalog.transform.InputTransformer)3 File (java.io.File)3 CatalogFramework (ddf.catalog.CatalogFramework)2 ByteArrayInputStream (java.io.ByteArrayInputStream)2 IOException (java.io.IOException)2 ArrayList (java.util.ArrayList)2 Attachment (org.apache.cxf.jaxrs.ext.multipart.Attachment)2 ContentDisposition (org.apache.cxf.jaxrs.ext.multipart.ContentDisposition)2 BundleContext (org.osgi.framework.BundleContext)2 ServiceReference (org.osgi.framework.ServiceReference)2 StorageProvider (ddf.catalog.content.StorageProvider)1 ContentItem (ddf.catalog.content.data.ContentItem)1 ContentItemImpl (ddf.catalog.content.data.impl.ContentItemImpl)1 MockMemoryStorageProvider (ddf.catalog.content.impl.MockMemoryStorageProvider)1 CreateStorageRequest (ddf.catalog.content.operation.CreateStorageRequest)1 CreateStorageRequestImpl (ddf.catalog.content.operation.impl.CreateStorageRequestImpl)1