import org.nuxeo.ecm.platform.types.TypeManager;
import org.nuxeo.ecm.core.api.CoreSession;
import org.nuxeo.ecm.core.api.IdRef;
+import org.nuxeo.ecm.core.api.NuxeoException;
import org.nuxeo.ecm.core.api.blobholder.BlobHolder;
import org.nuxeo.ecm.core.api.blobholder.DocumentBlobHolder;
import org.nuxeo.ecm.core.api.impl.blob.FileBlob;
boolean useNuxeoAdaptors) throws Exception {
DocumentModel result = null;
- if (useNuxeoAdaptors == true) {
+ boolean createdFromAdaptor = false;
+ if (useNuxeoAdaptors == true) try {
//
// Use Nuxeo's high-level create method which looks for plugin adapters that match the MIME type. For example,
// for image blobs, Nuxeo's file manager will pick a special image plugin that will automatically generate
//
result = getFileManager().createDocumentFromBlob(
repoSession.getCoreSession(), inputStreamBlob, blobLocation, overwrite, blobName);
- } else {
+ createdFromAdaptor = true;
+ } catch (NuxeoException ne) {
+ logger.warn(String.format("Tried but failed to use Nuxeo import adaptor to download '%s'. Falling back to generic file importer",
+ blobName));
+ }
+
+ if (createdFromAdaptor == false) {
//
// User Nuxeo's default file importer/adapter explicitly. This avoids specialized functionality from happening like
// image derivative creation.
* Blob blob = document.getProperty("file:content"); htmlDoc = blob.getString();
* // the content is decoded from UTF-8 into a java string
*/
+