code: public static boolean directoryContains(final String canonicalParent, final String canonicalChild) throws IOException {
  
          // Fail fast against NullPointerException
          if (canonicalParent == null) {
              throw new IllegalArgumentException("Directory must not be null");
          }
  
          if (canonicalChild == null) {
              return false;
          }
  
          if (IOCase.SYSTEM.checkEquals(canonicalParent, canonicalChild)) {
              return false;
          }
  
          return IOCase.SYSTEM.checkStartsWith(canonicalChild, canonicalParent);
      }
docs: Determines whether the {@code parent} directory contains the {@code child} element (a file or directory).
  <p>
  The files names are expected to be normalized.
  </p>
  
  Edge cases:
  <ul>
  <li>A {@code directory} must not be null: if null, throw IllegalArgumentException</li>
  <li>A directory does not contain itself: return false</li>
  <li>A null child file is not contained in any parent: return false</li>
  </ul>
  
  @param canonicalParent
  the file to consider as the parent.
  @param canonicalChild
  the file to consider as the child.
  @return true is the candidate leaf is under by the specified composite. False otherwise.
  @throws IOException
  if an IO error occurs while checking the files.
  @since 2.2