code: protected void customizeConnection(URLConnection con) throws IOException {
          ResourceUtils.useCachesIfNecessary(con);
          if (con instanceof HttpURLConnection) {
              customizeConnection((HttpURLConnection) con);
          }
      }
docs: Customize the given {@link URLConnection}, obtained in the course of an
  {@link #exists()}, {@link #contentLength()} or {@link #lastModified()} call.
  <p>Calls {@link ResourceUtils#useCachesIfNecessary(URLConnection)} and
  delegates to {@link #customizeConnection(HttpURLConnection)} if possible.
  Can be overridden in subclasses.
  
  @param con the URLConnection to customize
  @throws IOException if thrown from URLConnection methods