Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Get a real file path for a resource in Tomcat
- // get resource
- URL resU = servletContext.getResource("style.less");
- // get scratch dir
- File workDir = (File) servletContext.getAttribute("javax.servlet.context.tempdir");
- // copy resource to scratch file
- File newFile = new File(workDir, "style.less");
- Files.write(Resources.toByteArray(resU), newFile); // Google Guava
- File file = File.createTempFile("style", ".less");
- // ...
Add Comment
Please, Sign In to add comment