How to detect whether a file is part of a webapp resource dir


I keep it short and simple, how do I detect if a virtual file is part of a web resource dir.

For normal sources and resources this seems to do the trick


But this fails for web resources by returning null on them. I guess the necessary code is in a plugin which is not opensource, but there might be a way to achieve that.





Comment actions Permalink

com.intellij.javaee.web.WebUtil#isInsideWebRoots(com.intellij.openapi.vfs.VirtualFile, com.intellij.openapi.project.Project) (requires JavaEE plugin)

Comment actions Permalink

Thanks a lot.

That will help me a lot, it was not that obvious.

Cheers and thanks for the quick answer.

Btw. just in case you guys are interested:

it does some stuff differently and is complentary to your angular tooling in parts.



Please sign in to leave a comment.