Top Description Constructors Methods
org.eclipse.jgit.lfs

public Class BuiltinLFS

extends LfsFactory
Class Inheritance
Imports
java.io.IOException, .InputStream, .PrintStream, org.eclipse.jgit.annotations.Nullable, org.eclipse.jgit.attributes.Attribute, org.eclipse.jgit.hooks.PrePushHook, org.eclipse.jgit.lib.ConfigConstants, .ObjectLoader, .Repository, org.eclipse.jgit.util.LfsFactory

Implementation of LfsFactory, using built-in (optional) LFS support.
Since
4.11

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public LfsFactory.LfsInputStream
applyCleanFilter(Repository
the repository
db
,
InputStream
the original input
input
,
long
the expected input stream length
length
,
Attribute
the attribute used to check for LFS enablement (i.e. "merge", "diff", "filter" from .gitattributes).
attribute
)

Overrides org.eclipse.jgit.util.LfsFactory.applyCleanFilter.

Apply clean filtering to the given stream, writing the file content to the LFS storage if required and returning a stream to the LFS pointer instead.

public ObjectLoader
applySmudgeFilter(Repository
the repository
db
,
ObjectLoader
the loader for the blob
loader
,
Attribute
the attribute used to check for LFS enablement (i.e. "merge", "diff", "filter" from .gitattributes).
attribute
)

Overrides org.eclipse.jgit.util.LfsFactory.applySmudgeFilter.

Apply smudge filtering to a given loader, potentially redirecting it to a LFS blob which is downloaded on demand.

public LfsFactory.LfsInstallCommand
getInstallCommand()

Overrides org.eclipse.jgit.util.LfsFactory.getInstallCommand.

Retrieve an LfsInstallCommand which can be used to enable LFS support (if available) either per repository or for the user.

public PrePushHook
getPrePushHook(Repository
the Repository the hook is applied to.
repo
,
PrintStream
output stream
outputStream
)

Overrides org.eclipse.jgit.util.LfsFactory.getPrePushHook.

Retrieve a pre-push hook to be applied using the default error stream.

public PrePushHook
getPrePushHook(Repository
the Repository the hook is applied to.
repo
,
PrintStream
output stream
outputStream
,
PrintStream
error stream
errorStream
)

Overrides org.eclipse.jgit.util.LfsFactory.getPrePushHook.

Retrieve a pre-push hook to be applied.

public boolean
isAvailable()

Overrides org.eclipse.jgit.util.LfsFactory.isAvailable.

Whether LFS support is available

public boolean

Returns:

whether LFS is requested for the given repo.
isEnabled
(Repository
the repository
db
)

Overrides org.eclipse.jgit.util.LfsFactory.isEnabled.

Whether LFS is enabled

private boolean

Returns:

whether LFS filter is enabled for the given .gitattribute attribute.
isEnabled
(Repository
the repository
db
,
Attribute
the attribute to check
attribute
)

public static void
register()

Activates the built-in LFS support.

Inherited from org.eclipse.jgit.util.LfsFactory:
getAttributesForPathgetAttributesForPathgetInstancesetInstance

Constructor Detail

BuiltinLFSback to summary
private BuiltinLFS()

Method Detail

applyCleanFilterback to summary
public LfsFactory.LfsInputStream applyCleanFilter(Repository db, InputStream input, long length, Attribute attribute) throws IOException

Overrides org.eclipse.jgit.util.LfsFactory.applyCleanFilter.

Doc from org.eclipse.jgit.util.LfsFactory.applyCleanFilter.

Apply clean filtering to the given stream, writing the file content to the LFS storage if required and returning a stream to the LFS pointer instead.

Parameters
db:Repository

the repository

input:InputStream

the original input

length:long

the expected input stream length

attribute:Attribute

the attribute used to check for LFS enablement (i.e. "merge", "diff", "filter" from .gitattributes).

Returns:LfsFactory.LfsInputStream

a stream to the content that should be written to the object store along with the expected length of the stream. the original stream is not applicable.

Annotations
@Override
Exceptions
IOException:
in case of an error
applySmudgeFilterback to summary
public ObjectLoader applySmudgeFilter(Repository db, ObjectLoader loader, Attribute attribute) throws IOException

Overrides org.eclipse.jgit.util.LfsFactory.applySmudgeFilter.

Doc from org.eclipse.jgit.util.LfsFactory.applySmudgeFilter.

Apply smudge filtering to a given loader, potentially redirecting it to a LFS blob which is downloaded on demand.

Parameters
db:Repository

the repository

loader:ObjectLoader

the loader for the blob

attribute:Attribute

the attribute used to check for LFS enablement (i.e. "merge", "diff", "filter" from .gitattributes).

Returns:ObjectLoader

a loader for the actual data of a blob, or the original loader in case LFS is not applicable.

Annotations
@Override
Exceptions
IOException:
if an IO error occurred
getInstallCommandback to summary
public LfsFactory.LfsInstallCommand getInstallCommand()

Overrides org.eclipse.jgit.util.LfsFactory.getInstallCommand.

Doc from org.eclipse.jgit.util.LfsFactory.getInstallCommand.

Retrieve an LfsInstallCommand which can be used to enable LFS support (if available) either per repository or for the user.

Returns:LfsFactory.LfsInstallCommand

a command to install LFS support.

Annotations
@Override
getPrePushHookback to summary
public PrePushHook getPrePushHook(Repository repo, PrintStream outputStream)

Overrides org.eclipse.jgit.util.LfsFactory.getPrePushHook.

Doc from org.eclipse.jgit.util.LfsFactory.getPrePushHook.

Retrieve a pre-push hook to be applied using the default error stream.

Parameters
repo:Repository

the Repository the hook is applied to.

outputStream:PrintStream

output stream

Returns:PrePushHook

a PrePushHook implementation or null

Annotations
@Override
@Nullable
getPrePushHookback to summary
public PrePushHook getPrePushHook(Repository repo, PrintStream outputStream, PrintStream errorStream)

Overrides org.eclipse.jgit.util.LfsFactory.getPrePushHook.

Doc from org.eclipse.jgit.util.LfsFactory.getPrePushHook.

Retrieve a pre-push hook to be applied.

Parameters
repo:Repository

the Repository the hook is applied to.

outputStream:PrintStream

output stream

errorStream:PrintStream

error stream

Returns:PrePushHook

a PrePushHook implementation or null

Annotations
@Override
@Nullable
isAvailableback to summary
public boolean isAvailable()

Overrides org.eclipse.jgit.util.LfsFactory.isAvailable.

Doc from org.eclipse.jgit.util.LfsFactory.isAvailable.

Whether LFS support is available

Returns:boolean

whether LFS support is available

Annotations
@Override
isEnabledback to summary
public boolean isEnabled(Repository db)

Overrides org.eclipse.jgit.util.LfsFactory.isEnabled.

Doc from org.eclipse.jgit.util.LfsFactory.isEnabled.

Whether LFS is enabled

Parameters
db:Repository

the repository

Returns:boolean

whether LFS is requested for the given repo.

Annotations
@Override
isEnabledback to summary
private boolean isEnabled(Repository db, Attribute attribute)
Parameters
db:Repository

the repository

attribute:Attribute

the attribute to check

Returns:boolean

whether LFS filter is enabled for the given .gitattribute attribute.

registerback to summary
public static void register()

Activates the built-in LFS support.