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

public abstract Class FilterCommand

extends Object
Class Inheritance
Imports
java.io.IOException, .InputStream, .OutputStream

An abstraction for JGit's builtin implementations for hooks and filters. Instead of spawning an external processes to start a filter/hook and to pump data from/to stdin/stdout these builtin commmands may be used. They are constructed by org.eclipse.jgit.attributes.FilterCommandFactory.
Since
4.6

Field Summary

Modifier and TypeField and Description
protected InputStream
in

The InputStream this command should read from

protected OutputStream
out

The OutputStream this command should write to

Constructor Summary

AccessConstructor and Description
public
FilterCommand(InputStream
The java.io.InputStream this command should read from
in
,
OutputStream
The java.io.OutputStream this command should write to
out
)

Constructor for FilterCommand

FilterCommand implementors are required to manage the in and out streams (close on success and/or exception).

Method Summary

Modifier and TypeMethod and Description
public abstract int

Returns:

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

Execute the command.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

inback to summary
protected InputStream in

The InputStream this command should read from

outback to summary
protected OutputStream out

The OutputStream this command should write to

Constructor Detail

FilterCommandback to summary
public FilterCommand(InputStream in, OutputStream out)

Constructor for FilterCommand

FilterCommand implementors are required to manage the in and out streams (close on success and/or exception).

Parameters
in:InputStream

The java.io.InputStream this command should read from

out:OutputStream

The java.io.OutputStream this command should write to

Method Detail

runback to summary
public abstract int run() throws IOException

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.

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