code: static List<String> getSubDirs(String objectName) {
      List<String> subdirs = new ArrayList<>();
      if (!Strings.isNullOrEmpty(objectName)) {
        int currentIndex = 0;
        while (currentIndex < objectName.length()) {
          int index = objectName.indexOf(PATH_DELIMITER, currentIndex);
          if (index < 0) {
            break;
          }
          subdirs.add(objectName.substring(0, index + PATH_DELIMITER.length()));
          currentIndex = index + PATH_DELIMITER.length();
        }
      }
      return subdirs;
    }
docs: For objects whose name looks like a path (foo/bar/zoo), returns intermediate sub-paths.
  
  <p>For example:
  
  <ul>
  <li>foo/bar/zoo => returns: (foo/, foo/bar/)
  <li>foo => returns: ()
  </ul>
  
  @param objectName Name of an object.
  @return List of sub-directory like paths.