public class FileContentUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
TEXT_X_GERRIT_COMMIT_MESSAGE |
static String |
TEXT_X_GERRIT_MERGE_LIST |
| Modifier and Type | Method and Description |
|---|---|
BinaryResult |
downloadContent(ProjectState project,
org.eclipse.jgit.lib.ObjectId revstr,
String path,
Integer parent) |
BinaryResult |
getContent(ProjectState project,
org.eclipse.jgit.lib.ObjectId revstr,
String path,
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,
String path) |
static String |
resolveContentType(ProjectState project,
String path,
PatchScript.FileMode fileMode,
String mimeType) |
public static final String TEXT_X_GERRIT_COMMIT_MESSAGE
public static final String TEXT_X_GERRIT_MERGE_LIST
public BinaryResult getContent(ProjectState project, org.eclipse.jgit.lib.ObjectId revstr, String path, Integer parent) throws BadRequestException, ResourceNotFoundException, 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.ResourceNotFoundExceptionIOExceptionBadRequestExceptionpublic BinaryResult getContent(org.eclipse.jgit.lib.Repository repo, ProjectState project, org.eclipse.jgit.lib.ObjectId revstr, String path) throws IOException, ResourceNotFoundException
IOExceptionResourceNotFoundExceptionpublic BinaryResult downloadContent(ProjectState project, org.eclipse.jgit.lib.ObjectId revstr, String path, Integer parent) throws ResourceNotFoundException, IOException
ResourceNotFoundExceptionIOExceptionpublic static String resolveContentType(ProjectState project, String path, PatchScript.FileMode fileMode, String mimeType)