code: @SuppressFBWarnings ("IL_INFINITE_LOOP")
    public static boolean isParentDirectory (@Nonnull final Path aSearchDirectory, @Nonnull final Path aStartDirectory)
    {
      ValueEnforcer.notNull (aSearchDirectory, "SearchDirectory");
      ValueEnforcer.notNull (aStartDirectory, "StartDirectory");
  
      Path aRealSearchDirectory = aSearchDirectory.toAbsolutePath ();
      Path aRealStartDirectory = aStartDirectory.toAbsolutePath ();
      try
      {
        aRealSearchDirectory = getCanonicalFile (aRealSearchDirectory);
        aRealStartDirectory = getCanonicalFile (aRealStartDirectory);
      }
      catch (final IOException ex)
      {
        // ignore
      }
      if (aRealSearchDirectory.toFile ().isDirectory ())
      {
        Path aParent = aRealStartDirectory;
        while (aParent != null)
        {
          if (aParent.equals (aRealSearchDirectory))
            return true;
          aParent = aParent.getParent ();
        }
      }
      return false;
    }
docs: Check if the searched directory is a parent object of the start directory
  
  @param aSearchDirectory
  The directory to be searched. May not be <code>null</code>.
  @param aStartDirectory
  The directory where the search starts. May not be <code>null</code>.
  @return <code>true</code> if the search directory is a parent of the start
  directory, <code>false</code> otherwise.
  @see #getCanonicalFile(Path)