Behavior of parse on invalid URLs

And am still somehow confused about the parse() function since we haven’t implemented it yet. For example: Can I just assume that the “/” at the beginning of the path is there or must I check it myself. Because I think (but not sure) that it will get an error when calling parse() if “/” is absent or am I wrong?

To quote the UriParser interface:

	/**
	 * @return the parsed {@link Uri} instance or null when the string is not a
	 *         valid {@link Uri} with regards to the grammar given in
	 *         {@link Uri}
	 */
	public Uri parse();

Keep in mind that it might be the case that the path is empty.
There are multiple cases:

  • There is no path
  • There is a path satisfying the grammar
  • There is an invalid path in the URL

In cases where the URL is invalid, parse will return null.