code: public static Resource getResource(String resourceSpec) {
          log.trace("retrieving resource -> " + resourceSpec);
          try {
  
              if (resourceSpec.startsWith("file:")) {
                  return new ResourceImpl(normFile(resourceSpec.substring(5)).toURI().toURL());
              }
  
              if (resourceSpec.startsWith("classpath:")) {
                  String name = resourceSpec.substring(10);
                  if (name.startsWith("/")) {
                      throw new IllegalArgumentException("Classpath resource cannot start with '/': " + name);
                  }
                  if (name.indexOf('\\') != -1) {
                      throw new IllegalArgumentException("Classpath resource cannot contain '\\': " + name);
                  }
                  URL url = getLoader().getResource(name);
                  if (url == null) {
                      return null;
                  }
                  return new ResourceImpl(url);
              }
              log.error("Invalid resource specification: " + resourceSpec);
              return null;
          } catch (Exception e) {
              log.error("Could not retrieve resource: " + e.getMessage(), e);
              return null;
          }
      }
docs: Retrieves a resource handle by locator and name.
  <p/>
  Resources can be either files or directories. They must be specified by an expression formed of two
  parts, the type of locator, and resource name. Resource names are always specified with forward
  slashes. Usage:
  <ul>
  <li><code>classpath:com/company/Resource</code>: Creates a resource from the classpath. Do not start
  the resource name with a slash.
  a last
  <li><code>file:path/to/file</code>: Creates a resource from the filesystem. The path can be either
  relative or absolute.
  </ul>
  
  @param resourceSpec Resource name including the locator specification (file: or classpath:)
  @return resource or null if the resource could not be located