public static File copyClass(final String targetPath, final @NonNls String className, final boolean deleteOnExit) throws IOException{
    final File targetDir = new File(targetPath).getAbsoluteFile();
    final File file = new File(targetDir, className + ".class");
    FileUtil.createParentDirs(file);
    if (deleteOnExit) {
      for (File f = file; f != null && !FileUtil.filesEqual(f, targetDir); f = FileUtilRt.getParentFile(f)) {
        f.deleteOnExit();
      }
    }
    final @NonNls String resourceName = "/" + className + ".class";
    final InputStream stream = CopyResourcesUtil.class.getResourceAsStream(resourceName);
    if (stream == null) {
      throw new IOException("cannot load " + resourceName);
    }
    return copyStreamToFile(stream, file);
  }
public static File copyClass(final String targetPath, final @NonNls String className, final boolean deleteOnExit)