public class CleanCommand extends GitCommand<Set<String>>
repo
Modifier | Constructor and Description |
---|---|
protected |
CleanCommand(Repository repo)
Constructor for CleanCommand
|
Modifier and Type | Method and Description |
---|---|
Set<String> |
call() |
CleanCommand |
setCleanDirectories(boolean dirs)
If dirs is set, in addition to files, also clean directories.
|
CleanCommand |
setDryRun(boolean dryRun)
If dryRun is set, the paths in question will not actually be deleted.
|
CleanCommand |
setForce(boolean force)
If force is set, directories that are git repositories will also be
deleted.
|
CleanCommand |
setIgnore(boolean ignore)
If ignore is set, don't report/clean files/directories that are ignored
by a .gitignore.
|
CleanCommand |
setPaths(Set<String> paths)
If paths are set, only these paths are affected by the cleaning.
|
checkCallable, getRepository, setCallable
protected CleanCommand(Repository repo)
repo
- the Repository
public Set<String> call() throws NoWorkTreeException, GitAPIException
Execute the command
Executes the clean
command with all the options and parameters
collected by the setter methods of this class. Each instance of this
class should only be used for one invocation of the command (means: one
call to call()
)
call
in interface Callable<Set<String>>
call
in class GitCommand<Set<String>>
NoWorkTreeException
GitAPIException
public CleanCommand setPaths(Set<String> paths)
paths
- the paths to set (with /
as separator)this
public CleanCommand setDryRun(boolean dryRun)
dryRun
- whether to do a dry run or notthis
public CleanCommand setForce(boolean force)
force
- whether or not to delete git repositoriesthis
public CleanCommand setCleanDirectories(boolean dirs)
dirs
- whether to clean directories too, or only files.this
public CleanCommand setIgnore(boolean ignore)
ignore
- whether to respect .gitignore or not.this
Copyright © 2017 Eclipse JGit Project. All rights reserved.