I think that doesn't work on JAR files, does it? So it might be better to get the actual InputStream and leave the resolution of the file to the JVM internals (local file, JAR content, ...).