public static Resource forPath(final String path) throws UnknownResourceException {
  Resource resource;
  if (path.startsWith(ClasspathResource.PREFIX + ":")) {
    resource=new ClasspathResource(path);
  }
 else   if (path.startsWith(FileResource.PREFIX + ":")) {
    resource=new FileResource(path);
  }
 else {
    resource=forPath(FileResource.PREFIX + ":" + path);
  }
  return resource;
}

public static Resource forPath ( final String path ) throws UnknownResourceException { Resource resource ; if ( path . startsWith ( ClasspathResource . PREFIX + ":" ) ) { resource = new ClasspathResource ( path ) ; } else if ( path . startsWith ( FileResource . PREFIX + ":" ) ) { resource = new FileResource ( path ) ; } else { resource = forPath ( FileResource . PREFIX + ":" + path ) ; } return resource ; }
creates an instance for a path prefixed by either classpath : or file : .
