code: public static boolean isDirectory(OwncloudResource owncloudResource) {
      return UNIX_DIRECTORY.equals(
          Optional.ofNullable(owncloudResource)
                  .map(resource -> resource.getMediaType().toString())
                  .orElse(null));
    }
docs: Checks, if the OwncloudResource is a Directory
  @param owncloudResource OwncloudResource
  @return is it a Directory