Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-18058

Add a FileSystem Blob Provider

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 7.10
    • Component/s: BlobManager

      Description

      FileSystem blob provider has been added. It makes available as blobs specific files that are stored on a file system available from the server. Typical use case is when your content is handled by external applications that can't easily be updated for using Nuxeo REST API and for which it is easier to let the files on a standard file system.

      To use this feature, contribute a provider using:

        <extension target="org.nuxeo.ecm.core.blob.BlobManager" point="configuration">
          <blobprovider name="fs">
            <class>org.nuxeo.ecm.core.blob.FilesystemBlobProvider</class>
            <property name="root">/opt/nuxeo/nxsever/blobs</property>
          </blobprovider>
        </extension>
      

      The configured root property above is mandatory and restricts under which path legal blobs will be allowed to be created. Then to create a blob pointing to a file under this root one can use:

      BlobInfo blobInfo = new BlobInfo();
      blobInfo.key = "/opt/nuxeo/nxserver/blobs/foo/bar.pdf";
      blobInfo.mimeType = "application/pdf";
      BlobManager blobManager = Framework.getService(BlobManager.class);
      Blob blob = ((FilesystemBlobProvider) blobManager.getBlobProvider("fs")).createBlob(blobInfo);
      

      Internally the blob will then be stored in the database with a key of fs:foo/bar.pdf.

      Note: it might be interesting in the future to use an abstraction like Apache VFS for being able to access different kind of file systems, but this is not implemented at this stage.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: