Package org.eclipse.jgit.lfs
Class LfsBlobFilter
java.lang.Object
org.eclipse.jgit.lfs.LfsBlobFilter
Provides transparently either a stream to the blob or a LFS media file if
managed by LFS.
- Since:
- 4.11
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic TemporaryBuffercleanLfsBlob(Repository db, InputStream originalContent) Run the LFS clean filter on the given stream and return a stream to the LFS pointer file buffer.static ObjectLoadersmudgeLfsBlob(Repository db, ObjectLoader loader) In case the givenObjectLoaderpoints to a LFS pointer file replace the loader with one pointing to the LFS media file contents.
-
Constructor Details
-
LfsBlobFilter
public LfsBlobFilter()
-
-
Method Details
-
smudgeLfsBlob
In case the givenObjectLoaderpoints 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.- Parameters:
db- the repoloader- the loader for the blob- Returns:
- either the original loader, or a loader for the LFS media file if managed by LFS. Files are downloaded on demand if required.
- Throws:
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.- Parameters:
db- theRepositoryoriginalContent- theInputStreamto the original content- Returns:
- a
TemporaryBufferrepresenting the LFS pointer. The caller is responsible to destroy the buffer. - Throws:
IOException- in case of any error.
-