Model result = null;
if (factories != null && !factories.isEmpty()) {
// get extractor from the first available factory
ExtractorFactory factory =
(ExtractorFactory)factories.iterator().next();
Extractor extractor = factory.get();
RDFContainerFactory containerFactory =
new RDFContainerFactoryImpl();
RDFContainer container =
containerFactory.getRDFContainer(docId);
extractor.extract(
container.getDescribedUri(),
new BufferedInputStream(in, 8192),
null, mimeType, container);
in.close();
result = container.getModel();