code: private boolean validateResourceIsValid(final Resource externalResource) {
          boolean isValid = true;
  
          try {
              URL url = externalResource.getURL();
              if (url.getPath() != null && url.getPath().contains(".jar") && !url.getPath().contains("dummyConfig")) {
                  throw new IllegalArgumentException("The customer config file: \"config.properties\" was found in a jar file. This is not legal. Offending jar is: " + url.getPath());
              }
          } catch (IOException e) {
              isValid = false;
          }
  
          return isValid;
      }
docs: Make sure the URL is correct and exists. used to support different
  locations for a resources (E.g. under WEB-INF or not etc.)
  
  @param externalResource the resource to check it's validity.
  @return true if exists, false if not.