Package org.eclipse.jgit.lfs
Class LfsBlobFilter
- java.lang.Object
-
- org.eclipse.jgit.lfs.LfsBlobFilter
-
public class LfsBlobFilter extends Object
Provides transparently either a stream to the blob or a LFS media file if managed by LFS.- Since:
- 4.11
-
-
Constructor Summary
Constructors Constructor Description LfsBlobFilter()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static TemporaryBuffer
cleanLfsBlob(Repository db, InputStream originalContent)
Run the LFS clean filter on the given stream and return a stream to the LFS pointer file buffer.static ObjectLoader
smudgeLfsBlob(Repository db, ObjectLoader loader)
In case the givenObjectLoader
points to a LFS pointer file replace the loader with one pointing to the LFS media file contents.
-
-
-
Method Detail
-
smudgeLfsBlob
public static ObjectLoader smudgeLfsBlob(Repository db, ObjectLoader loader) throws IOException
In case the givenObjectLoader
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.- 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
- theRepository
originalContent
- theInputStream
to the original content- Returns:
- a
TemporaryBuffer
representing the LFS pointer. The caller is responsible to destroy the buffer. - Throws:
IOException
- in case of any error.
-
-