Minor update
Added method to get file of a supplied class.
This commit is contained in:
parent
533ee3e89b
commit
28c9b3b8e7
@ -124,4 +124,11 @@ public class SafeReflection {
|
||||
* @return True if class is nested otherwise false.
|
||||
*/
|
||||
public static boolean isNestedClass(Class<?> c){ return c.getEnclosingClass()!=null; }
|
||||
|
||||
/**
|
||||
* Get class file based on class name.
|
||||
* @param c Class to find file of.
|
||||
* @return File if class file exists.
|
||||
*/
|
||||
public static java.io.File getClassFile(Class c){ return new java.io.File(c.getResource(c.getSimpleName()+".class").getFile()); }
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user