code: public static Resource create(File file)
    {
      try
      {
        String path = file.getCanonicalPath();
        if(file.isDirectory())
          path = PathUtils.addTrailingSlash(path);
        return create(new File("/"), path);
      }
      catch(IOException e)
      {
        throw new IllegalArgumentException("invalid file " + file, e);
      }
    }
docs: Creates a file resource from a file
  
  @param file the file
  @return the resource (points to this file)