Programatically add an external resource
Is there any way to programatically perform the task of going to IDE Settings | Resources | Configure External Resources | Add, and adding a new resource? I tried using ExternalResourceManager in the J2EE package of the open api, but this did not seem to do it.
Please sign in to leave a comment.
Hi,
It should really do it with call like
ExternalResourceManager.getInstance().addResource(url,idea url);
Kirk Woll wrote:
--
Maxim Mossienko
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
Huh, it must have been throwing an exception that I missed earlier because it's working for me now. Sorry about that, but thanks for your help.
I figured out what was confusing me earlier. I had put in code to check if the resource had already been added and to only add the resource if it hadn't. However, the method
ExternalResourceManager.getInstance().getResourceLocation
always returns whatever string I pass into the method. I was expecting it to return null if the resource didn't exist. Is there any way to check or should I always try to add it when the plugin initializes?
Hi,
If the method does not find anything then just passed url is returned.
Kirk Woll wrote:
--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"
Oh, right, I should have thought of that. Thanks, Maxim.