It has setters for all supported options and arguments of this command and a
call() method to finally execute the command. Each instance of this
class should only be used for one invocation of the command (means: one call
to call()).
Examples (git is a org. instance):
Remove file "test.txt" from both index and working directory:
git.rm().addFilepattern("test.txt").call();
Remove file "new.txt" from the index (but not from the working directory):
git.rm().setCached(true).addFilepattern("new.txt").call();
| Modifier and Type | Field and Description |
|---|---|
| private boolean | cached
Only remove files from index, not from working directory |
| private Collection |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public RmCommand | Returns: thisrepository-relative path of file to remove (with
filepattern)/ as separator)Add file name pattern of files to be removed |
| public DirCache | call()
Implements abstract org. Implements java. Computes a result, or throws an exception if unable to do so. |
| private boolean | |
| public RmCommand | Returns: thistrue if files should only be removed from index,
false if files should also be deleted from the working
directoryOnly remove the specified files from the index. |
| cached | back to summary |
|---|---|
| private boolean cached Only remove files from index, not from working directory | |
| filepatterns | back to summary |
|---|---|
| private Collection<String> filepatterns | |
| RmCommand | back to summary |
|---|---|
| public RmCommand(Repository repo) Constructor for RmCommand.
| |
| addFilepattern | back to summary |
|---|---|
| public RmCommand addFilepattern(String filepattern) Add file name pattern of files to be removed | |
| call | back to summary |
|---|---|
| public DirCache call() throws GitAPIException, NoFilepatternException Implements abstract org. Implements java. Doc from org. Computes a result, or throws an exception if unable to do so. Execute the command
Executes the
| |
| delete | back to summary |
|---|---|
| private boolean delete(File p) | |
| setCached | back to summary |
|---|---|
| public RmCommand setCached(boolean cached) Only remove the specified files from the index.
| |