Class FileHeaderUtil
java.lang.Object
com.google.gerrit.server.patch.gitfilediff.FileHeaderUtil
A utility class for the
FileHeader
JGit object-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Patch.ChangeType
getChangeType
(org.eclipse.jgit.patch.FileHeader header) Returns the change type associated with the file header.static com.google.common.collect.ImmutableList<String>
getHeaderLines
(String header) static com.google.common.collect.ImmutableList<String>
getHeaderLines
(org.eclipse.jgit.patch.FileHeader fileHeader) Splits theFileHeader
string to a list of strings, one string per header line.getNewPath
(org.eclipse.jgit.patch.FileHeader header) Returns the new file path associated with theFileHeader
, or empty if the file isPatch.ChangeType.DELETED
.getOldPath
(org.eclipse.jgit.patch.FileHeader header) Returns the old file path associated with theFileHeader
, or empty if the file isPatch.ChangeType.ADDED
orPatch.ChangeType.REWRITE
.static Patch.PatchType
getPatchType
(org.eclipse.jgit.patch.FileHeader header)
-
Constructor Details
-
FileHeaderUtil
public FileHeaderUtil()
-
-
Method Details
-
getHeaderLines
public static com.google.common.collect.ImmutableList<String> getHeaderLines(org.eclipse.jgit.patch.FileHeader fileHeader) Splits theFileHeader
string to a list of strings, one string per header line. -
getHeaderLines
-
getOldPath
Returns the old file path associated with theFileHeader
, or empty if the file isPatch.ChangeType.ADDED
orPatch.ChangeType.REWRITE
. -
getNewPath
Returns the new file path associated with theFileHeader
, or empty if the file isPatch.ChangeType.DELETED
. -
getChangeType
Returns the change type associated with the file header. -
getPatchType
-