Class RestoreFileModification
- java.lang.Object
- 
- com.google.gerrit.server.edit.tree.RestoreFileModification
 
- 
- All Implemented Interfaces:
- TreeModification
 
 public class RestoreFileModification extends Object implements TreeModification ATreeModificationwhich restores a file. The file is added again if it was present before the specified commit or deleted if it was absent.
- 
- 
Constructor SummaryConstructors Constructor Description RestoreFileModification(String filePath)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.common.collect.ImmutableSet<String>getFilePaths()Indicates all file paths affected by thisTreeModification.List<org.eclipse.jgit.dircache.DirCacheEditor.PathEdit>getPathEdits(org.eclipse.jgit.lib.Repository repository, org.eclipse.jgit.lib.ObjectId treeId, com.google.common.collect.ImmutableList<? extends org.eclipse.jgit.lib.ObjectId> parents)Returns a list ofPathEdits which are necessary in order to achieve the desired modification of the Git tree.
 
- 
- 
- 
Constructor Detail- 
RestoreFileModificationpublic RestoreFileModification(String filePath) 
 
- 
 - 
Method Detail- 
getPathEditspublic List<org.eclipse.jgit.dircache.DirCacheEditor.PathEdit> getPathEdits(org.eclipse.jgit.lib.Repository repository, org.eclipse.jgit.lib.ObjectId treeId, com.google.common.collect.ImmutableList<? extends org.eclipse.jgit.lib.ObjectId> parents) throws IOException Description copied from interface:TreeModificationReturns a list ofPathEdits which are necessary in order to achieve the desired modification of the Git tree. The order of thePathEdits can be crucial and hence shouldn't be changed.- Specified by:
- getPathEditsin interface- TreeModification
- Parameters:
- repository- the affected Git repository
- treeId- tree to which the modification is applied. A value of- ObjectId.zero()indicates an empty tree.
- parents- parent commits of the commit to whose tree this modification is applied
- Returns:
- an ordered list of necessary PathEdits
- Throws:
- IOException- if problems arise when accessing the repository
 
 - 
getFilePathspublic com.google.common.collect.ImmutableSet<String> getFilePaths() Description copied from interface:TreeModificationIndicates all file paths affected by thisTreeModification. If the modification refers to several file paths (e.g. renaming a file), all of them must be returned.- Specified by:
- getFilePathsin interface- TreeModification
- Returns:
- all affected file paths
 
 
- 
 
-