code: public static /*@Nullable*/String getParent(String path)
      {
          if (path == null) throw new IllegalArgumentException("'path' can't be null");
          if (path.length() == 0) return null;
          if (!path.startsWith("/")) throw new IllegalArgumentException("Not a valid path.  Doesn't start with a \"/\": \"" + path + "\"");
          if (path.endsWith("/")) throw new IllegalArgumentException("Not a valid path.  Ends with a \"/\": \"" + path + "\"");
  
          int lastSlash = path.lastIndexOf("/");
          return path.substring(0, lastSlash);
      }
docs: Returns the parent path of the given path or {@code null} if the path
  is {@code "/"}.
  <ul>
  <li>{@code getParent("")} &rarr; {@code null}</li>
  <li>{@code getParent("/Photos")} &rarr; {@code "/"}</li>
  <li>{@code getParent("/Photos/Recent/Home.jpeg")} &rarr; {@code "/Photos/Recent"}</li>
  </ul>