org.eclipse.jgit.api
Class GarbageCollectCommand

java.lang.Object
  extended by org.eclipse.jgit.api.GitCommand<Properties>
      extended by org.eclipse.jgit.api.GarbageCollectCommand
All Implemented Interfaces:
Callable<Properties>

public class GarbageCollectCommand
extends GitCommand<Properties>

A class used to execute a gc command. 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())

Since:
2.2
See Also:
Git documentation about gc

Field Summary
 
Fields inherited from class org.eclipse.jgit.api.GitCommand
repo
 
Constructor Summary
protected GarbageCollectCommand(Repository repo)
           
 
Method Summary
 Properties call()
          Executes the command
 GarbageCollectCommand setExpire(Date expire)
          During gc() or prune() each unreferenced, loose object which has been created or modified after expire will not be pruned.
 GarbageCollectCommand setProgressMonitor(ProgressMonitor monitor)
           
 
Methods inherited from class org.eclipse.jgit.api.GitCommand
checkCallable, getRepository, setCallable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GarbageCollectCommand

protected GarbageCollectCommand(Repository repo)
Parameters:
repo -
Method Detail

setProgressMonitor

public GarbageCollectCommand setProgressMonitor(ProgressMonitor monitor)
Parameters:
monitor - a progress monitor
Returns:
this instance

setExpire

public GarbageCollectCommand setExpire(Date expire)
During gc() or prune() each unreferenced, loose object which has been created or modified after expire will not be pruned. Only older objects may be pruned. If set to null then every object is a candidate for pruning. Use GitDateParser to parse time formats used by git gc.

Parameters:
expire - minimal age of objects to be pruned.
Returns:
this instance

call

public Properties call()
                throws GitAPIException
Description copied from class: GitCommand
Executes the command

Specified by:
call in interface Callable<Properties>
Specified by:
call in class GitCommand<Properties>
Returns:
T a result. Each command has its own return type
Throws:
GitAPIException - or subclass thereof when an error occurs


Copyright © 2013. All Rights Reserved.