Top Description Fields Constructors Methods
org.eclipse.jgit.lfs

public Class SmudgeFilter

extends FilterCommand
Class Inheritance
Static Imports
java.nio.charset.StandardCharsets.UTF_8

Built-in LFS smudge filter When content is read from git's object-database and written to the filesystem and this filter is configured for that content, then this filter will replace the content of LFS pointer files with the original content. This happens e.g. when a checkout needs to update a working tree file which is under LFS control.
Since
4.6

Field Summary

Modifier and TypeField and Description
public static final FilterCommandFactory
FACTORY

The factory is responsible for creating instances of org.eclipse.jgit.lfs.SmudgeFilter

private static final int
MAX_COPY_BYTES

Max number of bytes to copy in a single run() call.

Inherited from org.eclipse.jgit.attributes.FilterCommand:
inout

Constructor Summary

AccessConstructor and Description
public
SmudgeFilter(Repository db, InputStream
a java.io.InputStream object. The stream is closed in any case.
in
,
OutputStream out)

Constructor for SmudgeFilter.

private

Method Summary

Modifier and TypeMethod and Description
public static Collection<Path>

Returns:

the paths of all mediafiles which have been downloaded
downloadLfsResource
(Lfs
local Lfs storage.
lfs
,
Repository
the repository to work with
db
,
LfsPointer...
the objects to download
res
)

Download content which is hosted on a LFS server

pack-priv static void
register()

Register this filter in JGit

public int
run()

Implements abstract org.eclipse.jgit.attributes.FilterCommand.run.

Execute the command.

Field Detail

FACTORYback to summary
public static final FilterCommandFactory FACTORY

The factory is responsible for creating instances of org.eclipse.jgit.lfs.SmudgeFilter

MAX_COPY_BYTESback to summary
private static final int MAX_COPY_BYTES

Max number of bytes to copy in a single run() call.

Constructor Detail

SmudgeFilterback to summary
public SmudgeFilter(Repository db, InputStream in, OutputStream out) throws IOException

Constructor for SmudgeFilter.

Parameters
db:Repository

a org.eclipse.jgit.lib.Repository object.

in:InputStream

a java.io.InputStream object. The stream is closed in any case.

out:OutputStream

a java.io.OutputStream object.

Exceptions
IOException:
in case of an error
SmudgeFilterback to summary
private SmudgeFilter(InputStream in, OutputStream out, Repository db) throws IOException

Method Detail

downloadLfsResourceback to summary
public static Collection<Path> downloadLfsResource(Lfs lfs, Repository db, LfsPointer... res) throws IOException

Download content which is hosted on a LFS server

Parameters
lfs:Lfs

local Lfs storage.

db:Repository

the repository to work with

res:LfsPointer[]

the objects to download

Returns:Collection<Path>

the paths of all mediafiles which have been downloaded

Exceptions
IOException:
if an IO error occurred
Since
4.11
registerback to summary
pack-priv static void register()

Register this filter in JGit

runback to summary
public int run() throws IOException

Implements abstract org.eclipse.jgit.attributes.FilterCommand.run.

Doc from org.eclipse.jgit.attributes.FilterCommand.run.

Execute the command. The command is supposed to read data from in and to write the result to out. It returns the number of bytes it read from in. It should be called in a loop until it returns -1 signaling that the java.io.InputStream is completely processed.

On successful completion (return -1) or on Exception, the streams in and out are closed by the implementation.

Returns:int

the number of bytes read from the java.io.InputStream or -1. -1 means that the java.io.InputStream is completely processed.

Annotations
@Override
Exceptions
IOException:
when java.io.IOException occurred while reading from in or writing to out