/** * Find the directory or jar file the class has been loaded from. * * @param c the class whose location is required. * @return the file or jar with the class or null if we cannot * determine the location. * * @since Ant 1.6 */ public static File getClassSource(Class<?> c) { return normalizeSource(Locator.getClassSource(c)); }
/** * Find the directory or a give resource has been loaded from. * * @param c the classloader to be consulted for the source * @param resource the resource whose location is required. * * @return the file with the resource source or null if * we cannot determine the location. * * @since Ant 1.6 */ public static File getResourceSource(ClassLoader c, String resource) { if (c == null) { c = LoaderUtils.class.getClassLoader(); } return normalizeSource(Locator.getResourceSource(c, resource)); }