private File getClassSource(ClassLoader loader, String className) { return LoaderUtils.getResourceSource( loader, LoaderUtils.classNameToResource(className)); }
LoaderUtils.getResourceSource( fixLoader, LoaderUtils.classNameToResource(BSF_SCRIPT_RUNNER)));
private static boolean mustSplit() { return LoaderUtils.getResourceSource(FTPTask.class.getClassLoader(), "/org/apache/commons/net/" + "ftp/FTP.class") == null; }
/** * Adds a classpath source which contains the given resource. * * TODO: [GH-213] this is extremely ugly; separate the code required to run on the * forked JVM into an isolated bundle and either create it on-demand (in temp. * files location?) or locate it in classpath somehow (in a portable way). */ private org.apache.tools.ant.types.Path addSlaveClasspath() { org.apache.tools.ant.types.Path path = new org.apache.tools.ant.types.Path(getProject()); String [] REQUIRED_SLAVE_CLASSES = { SlaveMain.class.getName(), Strings.class.getName(), MethodGlobFilter.class.getName(), TeeOutputStream.class.getName() }; for (String clazz : Arrays.asList(REQUIRED_SLAVE_CLASSES)) { String resource = clazz.replace(".", "/") + ".class"; File f = LoaderUtils.getResourceSource(getClass().getClassLoader(), resource); if (f != null) { path.createPath().setLocation(f); } else { throw new BuildException("Could not locate classpath for resource: " + resource); } } return path; } }
/** * Adds a classpath source which contains the given resource. * * TODO: [GH-213] this is extremely ugly; separate the code required to run on the * forked JVM into an isolated bundle and either create it on-demand (in temp. * files location?) or locate it in classpath somehow (in a portable way). */ private org.apache.tools.ant.types.Path addSlaveClasspath() { org.apache.tools.ant.types.Path path = new org.apache.tools.ant.types.Path(getProject()); String [] REQUIRED_SLAVE_CLASSES = { SlaveMain.class.getName(), Strings.class.getName(), MethodGlobFilter.class.getName(), TeeOutputStream.class.getName() }; for (String clazz : Arrays.asList(REQUIRED_SLAVE_CLASSES)) { String resource = clazz.replace(".", "/") + ".class"; File f = LoaderUtils.getResourceSource(getClass().getClassLoader(), resource); if (f != null) { path.createPath().setLocation(f); } else { throw new BuildException("Could not locate classpath for resource: " + resource); } } return path; } }
final File f = LoaderUtils.getResourceSource(JUnitTask.class.getClassLoader(), resource); if (f != null) {