public class Which
extends java.lang.Object
Constructor and Description |
---|
Which() |
Modifier and Type | Method and Description |
---|---|
static java.io.File |
jarFile(java.lang.Class clazz)
Locates the jar file that contains the given class.
|
static java.io.File |
jarFile(java.net.URL resource) |
static java.net.URL |
jarURL(java.lang.Class clazz)
Locates the jar file that contains the given class.
|
public static java.net.URL jarURL(java.lang.Class clazz) throws java.io.IOException
java.lang.IllegalArgumentException
- if failed to determine.java.io.IOException
public static java.io.File jarFile(java.lang.Class clazz) throws java.io.IOException
Note that jar files are not always loaded from File
,
so for diagnostics purposes jarURL(Class)
is preferrable.
java.lang.IllegalArgumentException
- if failed to determine.java.io.IOException
public static java.io.File jarFile(java.net.URL resource) throws java.io.IOException
java.io.IOException
Copyright © 2013. All Rights Reserved.