(Builder builder)
| 171 | @Nullable private final String fragment; |
| 172 | |
| 173 | private Uri(Builder builder) { |
| 174 | this.scheme = checkNotNull(builder.scheme, "scheme"); |
| 175 | this.userInfo = builder.userInfo; |
| 176 | this.host = builder.host; |
| 177 | this.port = builder.port; |
| 178 | this.path = builder.path; |
| 179 | this.query = builder.query; |
| 180 | this.fragment = builder.fragment; |
| 181 | |
| 182 | // Checks common to the parse() and Builder code paths. |
| 183 | if (hasAuthority()) { |
| 184 | if (!path.isEmpty() && !path.startsWith("/")) { |
| 185 | throw new IllegalArgumentException("Has authority -- Non-empty path must start with '/'"); |
| 186 | } |
| 187 | } else { |
| 188 | if (path.startsWith("//")) { |
| 189 | throw new IllegalArgumentException("No authority -- Path cannot start with '//'"); |
| 190 | } |
| 191 | } |
| 192 | } |
| 193 | |
| 194 | /** |
| 195 | * Parses a URI from its string form. |
nothing calls this directly
no test coverage detected