Class FileHeaderUtil

java.lang.Object
com.google.gerrit.server.patch.gitfilediff.FileHeaderUtil

public class FileHeaderUtil extends Object
A utility class for the FileHeader JGit object
  • Constructor Details

    • FileHeaderUtil

      public FileHeaderUtil()
  • Method Details

    • getHeaderLines

      public static com.google.common.collect.ImmutableList<String> getHeaderLines(org.eclipse.jgit.patch.FileHeader fileHeader)
      Splits the FileHeader string to a list of strings, one string per header line.
    • getHeaderLines

      public static com.google.common.collect.ImmutableList<String> getHeaderLines(String header)
    • getOldPath

      public static Optional<String> getOldPath(org.eclipse.jgit.patch.FileHeader header)
      Returns the old file path associated with the FileHeader, or empty if the file is Patch.ChangeType.ADDED or Patch.ChangeType.REWRITE.
    • getNewPath

      public static Optional<String> getNewPath(org.eclipse.jgit.patch.FileHeader header)
      Returns the new file path associated with the FileHeader, or empty if the file is Patch.ChangeType.DELETED.
    • getChangeType

      public static Patch.ChangeType getChangeType(org.eclipse.jgit.patch.FileHeader header)
      Returns the change type associated with the file header.
    • getPatchType

      public static Patch.PatchType getPatchType(org.eclipse.jgit.patch.FileHeader header)