private static File getWarLocation ( ) { URL resource = JettyConsoleBootstrapMainClass . class . getResource ( "/META-INF/jettyconsole/jettyconsole.properties" ) ; String file = resource . getFile ( ) ; file = file . substring ( "file:" . length ( ) , file . indexOf ( "!" ) ) ; try { file = URLDecoder . decode ( file , "utf-8" ) ; } catch ( UnsupportedEncodingException e ) { throw new RuntimeException ( e ) ; } return new File ( file ) ; }
Return a File pointing to the location of the Jar file this Main method is executed from .