How to programatically download Java source File?
Answered
I have a ClsClassImpl of a Java class inside of a library (no local project file).
I need the contents of the source code, which can be obtained via ClsClassImpl.getSourceMirrorClass, but only if the library sources have already been downloaded, otherwise it returns null.
How can I manually trigger the download of the library source?
I can see in AttachSourcesNotificationProvider that there can be different actions to download the sources jar (maven/gradle,…) but how do I trigger the download programatically?
Please sign in to leave a comment.
Hi Phil,
There is no API for that, and in general, sources should be downloaded by users explicitly. If you need to do it for some important reason, I suggest checking how specific actions for downloading sources are implemented.