Download file from github using Java

I wanted to download files from github using java code and not visiting github page. Want to dowonload subdirectory or subfolder from github by directly hitting url provided for download.

1 Like

Hey! You will want to use: https://docs.oracle.com/javase/6/docs/api/java/net/URL.html in order to make a request. 

If the content is Base64 encoded, you can use: https://developer.github.com/v3/repos/contents/

Otherwise, you may need to use: https://developer.github.com/v3/repos/releases/#get-a-single-release-asset to get the assets from the release. 

You may also want to check out: https://github-api.kohsuke.org

1 Like