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

public Class ApplyCommand

extends GitCommand<ApplyResult>
Class Inheritance
Imports
java.io.File, .IOException, .InputStream, java.text.MessageFormat, org.eclipse.jgit.api.errors.GitAPIException, .PatchApplyException, .PatchFormatException, org.eclipse.jgit.internal.JGitText, org.eclipse.jgit.lib.Repository, org.eclipse.jgit.patch.Patch, .PatchApplier, .PatchApplier.Result

Apply a patch to files and/or to the index.
Since
2.0
See Also
Git documentation about apply

Field Summary

Modifier and TypeField and Description
private InputStream
Inherited from org.eclipse.jgit.api.GitCommand:
repo

Constructor Summary

AccessConstructor and Description
pack-priv
ApplyCommand(Repository
the repository this command will be used on
repo
)

Constructs the command.

Method Summary

Modifier and TypeMethod and Description
public ApplyResult
call()

Implements abstract org.eclipse.jgit.api.GitCommand.call.

Implements java.util.concurrent.Callable.call.

Computes a result, or throws an exception if unable to do so.

public ApplyCommand

Returns:

this instance
setPatch
(InputStream
the patch to apply
in
)

Set patch

Inherited from org.eclipse.jgit.api.GitCommand:
checkCallablegetRepositorysetCallable

Field Detail

inback to summary
private InputStream in

Constructor Detail

ApplyCommandback to summary
pack-priv ApplyCommand(Repository repo)

Constructs the command.

Parameters
repo:Repository

the repository this command will be used on

Method Detail

callback to summary
public ApplyResult call() throws GitAPIException

Implements abstract org.eclipse.jgit.api.GitCommand.call.

Implements java.util.concurrent.Callable.call.

Doc from org.eclipse.jgit.api.GitCommand.call.

Computes a result, or throws an exception if unable to do so.

Execute the command

Executes the ApplyCommand command with all the options and parameters collected by the setter methods (e.g. setPatch(InputStream) of this class. Each instance of this class should only be used for one invocation of the command. Don't call this method twice on an instance.

Returns:ApplyResult

Doc from java.util.concurrent.Callable.call.

computed result

Annotations
@Override
setPatchback to summary
public ApplyCommand setPatch(InputStream in)

Set patch

Parameters
in:InputStream

the patch to apply

Returns:ApplyCommand

this instance