class URLJavaGenerator implements JavaGenerator {

  private static final Logger LOGGER = LoggerFactory.getLogger(URLJavaGenerator.class);

  private final Collection<URL> urls;
  private final File downloadDirectory;
  private final FileJavaGenerator delegate;

  public URLJavaGenerator(Config config, Collection<URL> urls, File downloadDirectory) {
    this.urls = urls;
    this.downloadDirectory = downloadDirectory;
    delegate = new FileJavaGenerator(config, downloadDirectory);
  }

  /**
   * {@inheritDoc}
   */
  @Override
  public void run(File outputDirectory) {
    if (urls == null || urls.isEmpty()) {
      throw new JavaGeneratorException("No URLs provided");
    }
    if (downloadDirectory == null) {
      throw new JavaGeneratorException(
          "Download directory is required");
    }
    if (!downloadDirectory.exists() && !downloadDirectory.mkdirs()) {
      throw new JavaGeneratorException("Unable to create download directory " + downloadDirectory.getAbsolutePath());
    }
    if (!downloadDirectory.isDirectory()) {
      throw new JavaGeneratorException(
          "Download directory " + downloadDirectory.getAbsolutePath() + " is not a valid directory");
    }
    LOGGER.info("Downloading CRDs from URLs: {}", urls);
    urls.forEach(this::downloadCRD);
    LOGGER.info("Generating Java classes from downloaded CRDs");
    delegate.run(outputDirectory);
  }

  private void downloadCRD(URL url) {<FILL_FUNCTION_BODY>}
}

    final File finalDestination = new File(downloadDirectory, new File(url.getFile()).getName());
    if (finalDestination.exists()) {
      LOGGER.warn("Skipping download of {} because it already exists at {}", url, finalDestination);
      return;
    }
    try (ReadableByteChannel readableByteChannel = Channels.newChannel(url.openStream());
        FileOutputStream fileOutputStream = new FileOutputStream(finalDestination)) {
      fileOutputStream.getChannel().transferFrom(readableByteChannel, 0, Long.MAX_VALUE);
    } catch (IOException e) {
      throw new JavaGeneratorException("Error downloading CRD from URL: " + url, e);
    }
  
<no_super_class>