code: public boolean isValid() {
          if (valid == null) {
              valid = (this.resource != null);
              if (valid) {
                  valid = (getResourceResolver().getResource(getPath()) != null);
              }
          }
          return valid;
      }
docs: a resource is valid if not 'null' and resolvable