Class LfsBlobFilter

  • public class LfsBlobFilter
    extends Object
    Provides transparently either a stream to the blob or a LFS media file if managed by LFS.
    • Constructor Detail

      • LfsBlobFilter

        public LfsBlobFilter()
    • Method Detail

      • smudgeLfsBlob

        public static ObjectLoader smudgeLfsBlob​(Repository db,
                                                 ObjectLoader loader)
                                          throws IOException
        In case the given ObjectLoader points to a LFS pointer file replace the loader with one pointing to the LFS media file contents. Missing LFS files are downloaded on the fly - same logic as the smudge filter.
        db - the repo
        loader - the loader for the blob
        either the original loader, or a loader for the LFS media file if managed by LFS. Files are downloaded on demand if required.
        IOException - in case of an error
      • cleanLfsBlob

        public static TemporaryBuffer cleanLfsBlob​(Repository db,
                                                   InputStream originalContent)
                                            throws IOException
        Run the LFS clean filter on the given stream and return a stream to the LFS pointer file buffer. Used when inserting objects.
        db - the Repository
        originalContent - the InputStream to the original content
        a TemporaryBuffer representing the LFS pointer. The caller is responsible to destroy the buffer.
        IOException - in case of any error.