Example #1
0
 /**
  * Returns true if the node that the path points to exists (Use with files only!)
  *
  * @param path repo path to check for existence
  */
 public static boolean exists(RepoPath path) {
   AqlSearchablePath aqlPath = new AqlSearchablePath(path);
   AqlApiItem aql =
       AqlApiItem.create()
           .filter(
               and(
                   AqlApiItem.repo().equal(aqlPath.getRepo()),
                   AqlApiItem.path().equal(aqlPath.getPath()),
                   AqlApiItem.name().equal(aqlPath.getFileName())));
   AqlEagerResult<AqlItem> results =
       ContextHelper.get().beanForType(AqlService.class).executeQueryEager(aql);
   return results != null && results.getResults() != null && results.getResults().size() > 0;
 }