code: public static boolean inNeo4jOwnedDirectory(File f) throws IOException {
          String canonicalPath = f.getCanonicalPath();
  
          for(String dirSetting : NEO4J_DIRECTORY_CONFIGURATION_SETTING_NAMES) {
              String actualDir = ApocConfiguration.get(dirSetting, null);
              if (canonicalPath.contains(actualDir)) {
                  return true;
              }
          }
  
          return false;
      }
docs: Given a file, determine whether it resides in neo4j controlled directory or not.  This method takes into account
  the possibility of symlinks / hardlinks.  Keep in mind Neo4j does not have one root home, but its configured
  directories may be spread all over the filesystem, so there's no parent.
  @param f the file to check
  @return true if the file's actual storage is in the neo4j home directory, false otherwise.  If f is a symlink
  that resides in a neo4j directory that points somewhere outside, returns false.
  @throws IOException if the canonical path cannot be determined.