diff --git a/src/main/java/org/gitlab4j/api/RepositoryFileApi.java b/src/main/java/org/gitlab4j/api/RepositoryFileApi.java index 88572f98168838dbf7d020d89d9ba5701e3f5979..e20695d7a0dadb70298348e87908f82c4ee719fd 100644 --- a/src/main/java/org/gitlab4j/api/RepositoryFileApi.java +++ b/src/main/java/org/gitlab4j/api/RepositoryFileApi.java @@ -5,13 +5,16 @@ import java.io.IOException; import java.io.InputStream; import java.nio.file.Files; import java.nio.file.StandardCopyOption; +import java.util.List; import java.util.Optional; +import java.util.stream.Stream; import javax.ws.rs.core.Form; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import org.gitlab4j.api.GitLabApi.ApiVersion; +import org.gitlab4j.api.models.Blame; import org.gitlab4j.api.models.RepositoryFile; /** @@ -461,4 +464,55 @@ public class RepositoryFileApi extends AbstractApi { addFormParam(form, "commit_message", commitMessage, true); return (form); } + + /** + * Get a List of file blame from repository. Allows you to receive blame information. + * Each blame range contains lines and corresponding commit information. + * + *
GitLab Endpoint: GET /projects/:id/repository/files/:file_path/blame
+ *
+ * @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
+ * @param filePath the path of the file to get the blame for
+ * @param ref the name of branch, tag or commit
+ * @return a List of Blame instances for the specified filePath and ref
+ * @throws GitLabApiException if any exception occurs
+ */
+ public ListGitLab Endpoint: GET /projects/:id/repository/files/:file_path/blame
+ *
+ * @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
+ * @param filePath the path of the file to get the blame for
+ * @param ref the name of branch, tag or commit
+ * @param itemsPerPage the number of Project instances that will be fetched per page
+ * @return a Pager of Blame instances for the specified filePath and ref
+ * @throws GitLabApiException if any exception occurs
+ */
+ public PagerGitLab Endpoint: GET /projects/:id/repository/files/:file_path/blame
+ *
+ * @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
+ * @param filePath the path of the file to get the blame for
+ * @param ref the name of branch, tag or commit
+ * @return a Stream of Blame instances for the specified filePath and ref
+ * @throws GitLabApiException if any exception occurs
+ */
+ public Stream