Issue
How to access a java file which is sitting in repo in a specific package. Bit bucket has meta data info like pullrequest api,last commit REST APIs. can you suggest/help me with sample rest call and also how to pass username and password? given that I know fully qualified class name including project.
note: we are using bitbucket which hosted with our organization.
Ex: https://bitbucket.org/repo/my-project branch: tempBranch file:src/main/java/temp/Main.java
I would like to access/view full content on Main.java with in the Rest call. is there any REST api exist for this ?
Solution
Strangely there is no way to do this using the latest version (2.0) of the bitbucket.org (cloud) API.
The available data from the /repositories/{username}/{repo}
endpoint may lead you to somewhere.
You can access files in the 'downloads' of your repo using the /repositories/{username}/{repo}/downloads/{filename}
endpoint.
However There is an endpoint for what you need in version 1.0 of the API. Based on testing this still works.
Answered By - Peter Reid
Answer Checked By - David Marino (JavaFixing Volunteer)