public class Which extends Object
| Constructor and Description |
|---|
Which() |
| Modifier and Type | Method and Description |
|---|---|
static URL |
classFileUrl(Class clazz)
Returns the URL of the class file where the given class has been loaded from.
|
static File |
jarFile(Class clazz)
Locates the jar file that contains the given class.
|
static File |
jarFile(URL resource) |
static URL |
jarURL(Class clazz)
Deprecated.
|
public static URL classFileUrl(Class clazz) throws IOException
IllegalArgumentException - if failed to determine.IOExceptionpublic static URL jarURL(Class clazz) throws IOException
classFileUrl(Class)IOExceptionpublic static File jarFile(Class clazz) throws IOException
Note that jar files are not always loaded from File,
so for diagnostics purposes jarURL(Class) is preferrable.
IllegalArgumentException - if failed to determine.IOExceptionpublic static File jarFile(URL resource) throws IOException
IOExceptionCopyright © 2004-2014. All Rights Reserved.