The main purpose of the following code is to grab the directory of the package of a classpath resource and use it to create a new file. It is used in our unit tests where we assume that classpath resources are in real directories. It's of course pornographic...
File file = new File(new File(getClass().getResource("noel.jpg").getPath()).getParentFile(), info.getFileName());
file.createNewFile();