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

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

Avatar

1 badge earned

Collect

Participate in fun challenges

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

Challenges
Coins

Gift kudos to your peers

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

Recognition
Ribbon

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!

Leaderboard

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
4,552,052
Community Members
 
Community Events
184
Community Groups

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

Edited

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

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events