Interface DocumentBlobManager

    • Method Detail

      • readBlob

        Blob readBlob​(BlobInfo blobInfo,
                      Document doc,
                      String xpath)
               throws IOException
        Reads a Blob from storage.
        Parameters:
        blobInfo - the blob information
        doc - the document to which this blob belongs
        xpath - the xpath of the blob in the document
        Returns:
        a managed blob
        Throws:
        IOException
        Since:
        11.1
      • writeBlob

        String writeBlob​(Blob blob,
                         Document doc,
                         String xpath)
                  throws IOException
        Writes a Blob to storage and returns its key.

        The passed blob may be null, in which case a null key is returned after checking that deleting this blob is allowed.

        Parameters:
        blob - the blob
        doc - the document to which this blob belongs
        xpath - the xpath of blob in doc
        Returns:
        the blob key
        Throws:
        IOException
        Since:
        9.1
      • getConvertedStream

        InputStream getConvertedStream​(Blob blob,
                                       String mimeType,
                                       DocumentModel doc)
                                throws IOException
        Gets an InputStream for a conversion to the given MIME type.

        Like all InputStream, the result must be closed when done with it to avoid resource leaks.

        Parameters:
        blob - the blob
        mimeType - the MIME type to convert to
        doc - the document that holds the blob
        Returns:
        the stream, or null if no conversion is available for the given MIME type
        Throws:
        IOException
        Since:
        7.2
      • freezeVersion

        void freezeVersion​(Document doc)
        Freezes the blobs' versions on a document version when it is created via a check in.
        Parameters:
        doc - the new document version
        Since:
        7.3
      • notifyChanges

        void notifyChanges​(Document doc,
                           Set<String> xpaths)
        Notifies the blob manager that a set of xpaths have changed on a document.
        Parameters:
        doc - the document
        xpaths - the set of changed xpaths
        Since:
        7.3
      • notifyMakeRecord

        void notifyMakeRecord​(Document doc)
        Notifies the blob manager that the document was made a record.
        Parameters:
        doc - the document
        Since:
        11.1
      • notifyAfterCopy

        void notifyAfterCopy​(Document doc)
        Notifies the blob manager that the document has been copied.
        Parameters:
        doc - the new document, the result of the copy
        Since:
        11.1
      • notifyBeforeRemove

        void notifyBeforeRemove​(Document doc)
        Notifies the blob manager that the document is about to be removed.
        Parameters:
        doc - the document
        Since:
        11.1
      • notifySetRetainUntil

        void notifySetRetainUntil​(Document doc,
                                  Calendar retainUntil)
        Notifies the blob manager that the document's retention date was changed.
        Parameters:
        doc - the document
        Since:
        11.1
      • notifySetLegalHold

        void notifySetLegalHold​(Document doc,
                                boolean hold)
        Notifies the blob manager that the document's legal hold status was changed.
        Parameters:
        doc - the document
        Since:
        11.1
      • garbageCollectBinaries

        BinaryManagerStatus garbageCollectBinaries​(boolean delete)
        Garbage collect the unused binaries.
        Parameters:
        delete - if false don't actually delete the garbage collected binaries (but still return statistics about them), if true delete them
        Returns:
        a status about the number of garbage collected binaries
        Since:
        7.4
      • isBinariesGarbageCollectionInProgress

        boolean isBinariesGarbageCollectionInProgress()
        Checks if a garbage collection of the binaries in progress.
        Returns:
        true if a garbage collection of the binaries is in progress
        Since:
        7.4
      • markReferencedBinary

        void markReferencedBinary​(String key,
                                  String repositoryName)
        INTERNAL. Marks a binary as referenced during garbage collection. Called back by repository implementations during garbageCollectBinaries(boolean).
        Parameters:
        key - the binary key
        repositoryName - the repository name
        Since:
        7.4