code: public static String getRawDirectory(final URI uri, final boolean strict) {
          return esc(strict).escapePath(getDirectory(getRawPath(uri, strict)));
      }
docs: Returns the raw (and normalized) directory portion of the given URI.  The directory is the raw path, up to and
  including the last slash.  This means that all directories start and end with a slash (but may be a single slash
  only).
  
  @param uri the URI to extract the directory from
  @param strict whether or not to do strict escaping
  @return the extracted directory