code: public Set<Path> update(Appcast appcast, Path targetDir) throws Exception {
          Set<Path> files;
          if (appcast == null) {
              throw new IllegalArgumentException("Appcast cannot be null!");
          }
          LOG.debug("Updating application ''{}''...", appcast.getTitle());
  
          // Download the update and verfiy it
          Path downloaded = appcastManager.download(appcast, targetDir);
          if (downloaded == null) {
              throw new Exception("Could not download update package for application '" + appcast.getTitle() + "'!");
          }
          LOG.debug("Downloaded update package ''{}''", downloaded);
  
          // Unzip the update if required
          files = ZipHandler.unzip(downloaded, targetDir, true);
          LOG.debug("Extracted files: {}", files);
  
          // Check if there is an update script available and execute it if so
          Map<String, Object> bindings = new HashMap<>();
          bindings.put("targetDir", targetDir);
          files.stream().filter((filePath) -> (filePath.getFileName().toString().endsWith(UPDATE_SCRIPT_SUFFIX))).forEach((filePath) -> {
              executeUpdateScript(filePath, bindings);
          }
docs: Update with the given appcast information in the specified targetDir
  
  @param appcast The appcast content (containing the file to download)
  @param targetDir The target directory for downloaded update files
  @return Updated files
  @throws Exception in case of an error