/** * Get the contents of the blob at the given path in the commit that HEAD * references. * * @param repository * @param path * @return content or null if no blob with path at HEAD commit */ public static String getHeadContent(final Repository repository, final String path) { return getContent(repository, HEAD, path); }
/** * Get content of note as string * * @param note * @return string */ protected String getContent(final Note note) { return BlobUtils.getContent(repository, note.getData()); }
protected String doGetContent(Git git, String objectId, String pathOrBlobPath) { objectId = defaultObjectId(git, objectId); Repository r = git.getRepository(); String blobPath = trimLeadingSlash(pathOrBlobPath); return BlobUtils.getContent(r, objectId, blobPath); }
protected String doGetContent(Git git, String objectId, String pathOrBlobPath) { objectId = defaultObjectId(git, objectId); Repository r = git.getRepository(); String blobPath = trimLeadingSlash(pathOrBlobPath); return BlobUtils.getContent(r, objectId, blobPath); }
Repository r = git.getRepository(); String blobPath = trimLeadingSlash(path); String content = BlobUtils.getContent(r, objectId, blobPath); FileDTO answer = FileDTO.createFileDTO(blobPath, objectId, content); return Response.ok(answer).build();