You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hi,
I'm making a BitBucket plugin using Java and I'm trying to get the names of all files/folders within a repository, starting from the top level. I currently have
ByteArrayOutputStream out = new ByteArrayOutputStream();
contentService.streamFile(repo, branchName, "basic_branching", (s) -> out);
This currently gets what I want from within the basic_branching folder included in the default repository generated when creating a plugin, however I want to get the contents from the level above, the top level of the master branch. I have tried using "" and "/" in place of "basic_branching" but I get an error saying the path needs to be specified. I have also tried req.getContextPath() and repo.getOrigin().toString(). Neither of which were what I wanted. Does anyone know the correct thing to put in here to get the contents from the top level, or is there is another method to do the same thing? Again I am only looking for the file/folder names, not the contents of the files.
Thanks