public class FileContentUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
TEXT_X_GERRIT_COMMIT_MESSAGE |
static java.lang.String |
TEXT_X_GERRIT_MERGE_LIST |
Modifier and Type | Method and Description |
---|---|
BinaryResult |
downloadContent(ProjectState project,
org.eclipse.jgit.lib.ObjectId revstr,
java.lang.String path,
java.lang.Integer parent) |
BinaryResult |
getContent(ProjectState project,
org.eclipse.jgit.lib.ObjectId revstr,
java.lang.String path,
java.lang.Integer parent)
Get the content of a file at a specific commit or one of it's parent commits.
|
BinaryResult |
getContent(org.eclipse.jgit.lib.Repository repo,
ProjectState project,
org.eclipse.jgit.lib.ObjectId revstr,
java.lang.String path) |
static java.lang.String |
resolveContentType(ProjectState project,
java.lang.String path,
PatchScript.FileMode fileMode,
java.lang.String mimeType) |
public static final java.lang.String TEXT_X_GERRIT_COMMIT_MESSAGE
public static final java.lang.String TEXT_X_GERRIT_MERGE_LIST
public BinaryResult getContent(ProjectState project, org.eclipse.jgit.lib.ObjectId revstr, java.lang.String path, java.lang.Integer parent) throws BadRequestException, ResourceNotFoundException, java.io.IOException
project
- A Project
that this request refers to.revstr
- An ObjectId
specifying the commit.path
- A string specifying the filepath.parent
- A 1-based parent index to get the content from instead. Null if the content
should be obtained from revstr
instead.BinaryResult
.ResourceNotFoundException
java.io.IOException
BadRequestException
public BinaryResult getContent(org.eclipse.jgit.lib.Repository repo, ProjectState project, org.eclipse.jgit.lib.ObjectId revstr, java.lang.String path) throws java.io.IOException, ResourceNotFoundException
java.io.IOException
ResourceNotFoundException
public BinaryResult downloadContent(ProjectState project, org.eclipse.jgit.lib.ObjectId revstr, java.lang.String path, java.lang.Integer parent) throws ResourceNotFoundException, java.io.IOException
ResourceNotFoundException
java.io.IOException
public static java.lang.String resolveContentType(ProjectState project, java.lang.String path, PatchScript.FileMode fileMode, java.lang.String mimeType)