code: public static boolean isFile(Resource resource) {
          return resource.isResourceType(ResourceUtil.TYPE_FILE) ||
                  resource.isResourceType(ResourceUtil.TYPE_LINKED_FILE);
      }
docs: Distinguishes file resources from resource folders: child is considered a resource folder if this is false.