Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

How to get all file/folder names using streamFile method?



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.


0 answers

Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events