Skip to content

Instantly share code, notes, and snippets.

@ldmarz
Created October 9, 2018 15:43
Show Gist options
  • Save ldmarz/54ce770c09ad5c979717dedf88b189fe to your computer and use it in GitHub Desktop.
Save ldmarz/54ce770c09ad5c979717dedf88b189fe to your computer and use it in GitHub Desktop.
Get arbitrary resources from a .war file JAVA
// 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