public class BuiltinLFS extends LfsFactory
LfsFactory
, using built-in (optional) LFS support.LfsFactory.LfsInputStream, LfsFactory.LfsInstallCommand
Modifier and Type | Method and Description |
---|---|
LfsFactory.LfsInputStream |
applyCleanFilter(Repository db,
InputStream input,
long length,
Attribute attribute)
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.
|
ObjectLoader |
applySmudgeFilter(Repository db,
ObjectLoader loader,
Attribute attribute)
Apply smudge filtering to a given loader, potentially redirecting it to a
LFS blob which is downloaded on demand.
|
LfsFactory.LfsInstallCommand |
getInstallCommand()
Retrieve an
LfsFactory.LfsInstallCommand which can be used to enable LFS
support (if available) either per repository or for the user. |
PrePushHook |
getPrePushHook(Repository repo,
PrintStream outputStream)
Retrieve a pre-push hook to be applied.
|
boolean |
isAvailable() |
boolean |
isEnabled(Repository db) |
static void |
register()
Activates the built-in LFS support.
|
getAttributesForPath, getAttributesForPath, getInstance, setInstance
public static void register()
public boolean isAvailable()
isAvailable
in class LfsFactory
public ObjectLoader applySmudgeFilter(Repository db, ObjectLoader loader, Attribute attribute) throws IOException
LfsFactory
applySmudgeFilter
in class LfsFactory
db
- the repositoryloader
- the loader for the blobattribute
- the attribute used to check for LFS enablement (i.e. "merge",
"diff", "filter" from .gitattributes).IOException
public LfsFactory.LfsInputStream applyCleanFilter(Repository db, InputStream input, long length, Attribute attribute) throws IOException
LfsFactory
applyCleanFilter
in class LfsFactory
db
- the repositoryinput
- the original inputlength
- the expected input stream lengthattribute
- the attribute used to check for LFS enablement (i.e. "merge",
"diff", "filter" from .gitattributes).IOException
- in case of an error@Nullable public PrePushHook getPrePushHook(Repository repo, PrintStream outputStream)
LfsFactory
getPrePushHook
in class LfsFactory
repo
- the Repository
the hook is applied to.PrePushHook
implementation or null
public boolean isEnabled(Repository db)
isEnabled
in class LfsFactory
db
- the repositorypublic LfsFactory.LfsInstallCommand getInstallCommand()
LfsFactory
LfsFactory.LfsInstallCommand
which can be used to enable LFS
support (if available) either per repository or for the user.getInstallCommand
in class LfsFactory
Copyright © 2018 Eclipse JGit Project. All rights reserved.