-
Notifications
You must be signed in to change notification settings - Fork 463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getRepositoryFileApi.getFile couldn't return the content of file #1133
Comments
I can not reproduce your issue. This works for me, with the test project https://gitlab.com/jmini/test_project/ Tested with this jbang script: ///usr/bin/env jbang "$0" "$@" ; exit $?
import org.gitlab4j.api.GitLabApi;
//DEPS org.gitlab4j:gitlab4j-api:5.6.0
//JAVA 17
public class GitlabGetFileScript {
public static void main(String[] args) throws Exception {
try (GitLabApi gitLabApi = new GitLabApi("https://gitlab.com/", null)) {
long projectId = 42335703L;
String branch = "main";
String readmePath = "README.md";
String testPath = "a_long_folder_name/test.txt";
System.out.println("README");
System.out.println(gitLabApi.getRepositoryFileApi()
.getFile(projectId, readmePath, branch, true));
System.out.println("TEST file");
System.out.println(gitLabApi.getRepositoryFileApi()
.getFile(projectId, testPath, branch, true));
}
}
} |
`package org.example; //JAVA 17 public class Main {
} ` |
I can't log in to your private gitlab instance. I am using gitlab4j with an on-prem gitlab installation all the time. Maybe if you log the HTTP request and response as explained in #1109 (comment) this will help you to understand what is going on. Also you will be able to execute the same queries with a tool like |
It can return the content of README.md, but return 404 Not Found when it get the content of src/App.vue.
I am pretty sure that my gitlab has 'src/App.vue' in that project and that branch
The text was updated successfully, but these errors were encountered: