A rather clever way of checking whether a class exists in the current class path:
public boolean classExists(String name) {
String resource = name.replace('.','/') + ".class";
return getClass().getClassLoader().getResource(resource) != null;
}
This was suggested by a java.net use "brucechapman" in response to Tom Ball's latest blog entry - Exceptional Debugging
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment