Top Description Constructors Methods
org.eclipse.jgit.lfs

public Class LfsBlobFilter

extends Object
Class Inheritance
Imports
java.io.IOException, .InputStream, java.nio.file.Files, .Path, org.eclipse.jgit.lfs.lib.AnyLongObjectId, org.eclipse.jgit.lib.ObjectLoader, .Repository, org.eclipse.jgit.util.TemporaryBuffer, .TemporaryBuffer.LocalFile

Provides transparently either a stream to the blob or a LFS media file if managed by LFS.
Since
4.11

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static TemporaryBuffer

Returns:

a TemporaryBuffer representing the LFS pointer. The caller is responsible to destroy the buffer.
cleanLfsBlob
(Repository db, InputStream
the InputStream to the original content
originalContent
)

Run the LFS clean filter on the given stream and return a stream to the LFS pointer file buffer.

public static ObjectLoader

Returns:

either the original loader, or a loader for the LFS media file if managed by LFS. Files are downloaded on demand if required.
smudgeLfsBlob
(Repository
the repo
db
,
ObjectLoader
the loader for the blob
loader
)

In case the given ObjectLoader points to a LFS pointer file replace the loader with one pointing to the LFS media file contents.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

LfsBlobFilterback to summary
public LfsBlobFilter()

Method Detail

cleanLfsBlobback to summary
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:Repository

the Repository

originalContent:InputStream

the InputStream to the original content

Returns:TemporaryBuffer

a TemporaryBuffer representing the LFS pointer. The caller is responsible to destroy the buffer.

Exceptions
IOException:
in case of any error.
smudgeLfsBlobback to summary
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.

Parameters
db:Repository

the repo

loader:ObjectLoader

the loader for the blob

Returns:ObjectLoader

either the original loader, or a loader for the LFS media file if managed by LFS. Files are downloaded on demand if required.

Exceptions
IOException:
in case of an error