Created
October 9, 2018 15:43
-
-
Save ldmarz/54ce770c09ad5c979717dedf88b189fe to your computer and use it in GitHub Desktop.
Get arbitrary resources from a .war file JAVA
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get string path from some resource | |
getClass().getResource('Some name resource').getPath() | |
// Get the resource can be as stream | |
getClass().getResource('some resource') | |
// Print where is the resource folder inside .war package | |
getClass().getResource('').getPath() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment