Class DeleteFileModification

java.lang.Object
com.google.gerrit.server.edit.tree.DeleteFileModification
All Implemented Interfaces:
TreeModification

public class DeleteFileModification extends Object implements TreeModification
A TreeModification which deletes a file.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    com.google.common.collect.ImmutableSet<String>
    Indicates all file paths affected by this TreeModification.
    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 of PathEdits which are necessary in order to achieve the desired modification of the Git tree.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DeleteFileModification

      public DeleteFileModification(String filePath)
  • Method Details

    • getPathEdits

      public 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)
      Description copied from interface: TreeModification
      Returns a list of PathEdits which are necessary in order to achieve the desired modification of the Git tree. The order of the PathEdits can be crucial and hence shouldn't be changed.
      Specified by:
      getPathEdits in 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
    • getFilePaths

      public com.google.common.collect.ImmutableSet<String> getFilePaths()
      Description copied from interface: TreeModification
      Indicates all file paths affected by this TreeModification. If the modification refers to several file paths (e.g. renaming a file), all of them must be returned.
      Specified by:
      getFilePaths in interface TreeModification
      Returns:
      all affected file paths