Skip to content

Instantly share code, notes, and snippets.

@jcrossley3
Created April 6, 2015 16:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jcrossley3/cf4d8599b1c73941ad4c to your computer and use it in GitHub Desktop.
Save jcrossley3/cf4d8599b1c73941ad4c to your computer and use it in GitHub Desktop.
/*
our classloader's classpath may contain more than one .jar, each with a manifest.
we need to ensure we get our own .jar's manifest, even if the jar is not first on the path.
we also need to deal with vfs, which does weird things to pathToThisClass e.g.
normal: jar:file:/foo/bar.jar!/com/arjuna/common/util/ConfigurationInfo.class
vfszip:/foo/bar.jar/com/arjuna/common/util/ConfigurationInfo.class
In short, this path finding code is magic and should be approached very cautiously.
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment