}
}
public Program createProgram(File jarPath, String classToLoad, File jarUnpackDir) throws Exception {
expandJar(jarPath, jarUnpackDir);
ProgramClassLoader classLoader = ClassLoaders.newProgramClassLoader(jarUnpackDir,
ApiResourceListHolder.getResourceList());
Class<?> clz = classLoader.loadClass(classToLoad);
if (!(clz.newInstance() instanceof Flow)) {
throw new Exception("Expected Flow class");
}
ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(classLoader);