code: public static String getParentDirectory(String filePath) throws IllegalArgumentException {
          if (Pattern.matches(sPatternUrl, filePath))
              return getURLParentDirectory(filePath);
  
          return new File(filePath).getParent();
      }
docs: Returns the directory of the file.
  
  @param filePath Path of the file.
  @return The directory string or {@code null} if
  there is no parent directory.
  @throws IllegalArgumentException if path is bad