code: @Nonnull
      /*package*/ static long getModificationDate(@Nonnull URL url) throws IOException {
          URLConnection uc = url.openConnection();
          
          // It prevents file descriptor leak if the URL references a file within JAR
          // See JENKINS-37332  for more info
          // The code idea is taken from https://github.com/jknack/handlebars.java/pull/394
          if (uc instanceof JarURLConnection) {
              final JarURLConnection connection = (JarURLConnection) uc;
              final URL jarURL = connection.getJarFileURL();
              if (jarURL.getProtocol().equals("file")) {
                  uc = null;
                  String file = jarURL.getFile();
                  return new File(file).lastModified();
              } else {
                  // We access the data without file protocol
                  if (connection.getEntryName() != null) {
                      LOGGER.log(WARNING, "Accessing modification date of {0} file, which is an entry in JAR file. "
                          + "The access protocol is not file:, falling back to the default logic (risk of file descriptor leak).",
                              url);
                  }
              }
          }
          
          // Fallbak to the default implementation
          return uc.getLastModified();
      }
docs: Retrieves modification date of the specified file.
  The method intelligently handles the case of {@link JarURLConnection} pointing to files within JAR.
  @param url Url of the file
  @return Modification date
  @throws IOException Operation error