@@ -184,26 +184,27 @@ private Map<String, String> parseUrl(String url) throws SQLException {
184
184
}
185
185
properties .put (PARSE_URL_CONN_URL_PROP , uri .getScheme () + "://"
186
186
+ uri .getRawAuthority ()); // will be parsed again later
187
+
187
188
if (uri .getPath () != null
188
- && !uri .getPath ().isBlank ()
189
+ && !uri .getPath ().trim (). isEmpty ()
189
190
&& !"/" .equals (uri .getPath ()))
190
191
{
191
192
properties .put (
192
193
ClientConfigProperties .DATABASE .getKey (),
193
194
uri .getPath ().substring (1 ));
194
195
}
195
- if (uri .getQuery () != null && !uri .getQuery ().isBlank ()) {
196
+ if (uri .getQuery () != null && !uri .getQuery ().trim (). isEmpty ()) {
196
197
for (String pair : uri .getRawQuery ().split ("&" )) {
197
198
String [] p = pair .split ("=" , 2 );
198
199
if (p .length != 2 || p [0 ] == null || p [1 ] == null ) {
199
200
throw new SQLException ("Invalid query parameter '" + pair + "'" );
200
201
}
201
202
String key = URLDecoder .decode (p [0 ], StandardCharsets .UTF_8 );
202
- if (key == null || key .isBlank () || !PATTERN_HTTP_TOKEN .matcher (key ).matches ()) {
203
+ if (key == null || key .trim (). isEmpty () || !PATTERN_HTTP_TOKEN .matcher (key ).matches ()) {
203
204
throw new SQLException ("Invalid query parameter key in pair'" + pair + "'" );
204
205
}
205
206
String value = URLDecoder .decode (p [1 ], StandardCharsets .UTF_8 );
206
- if (value == null || value .isBlank () || "=" .equals (value )) {
207
+ if (value == null || value .trim (). isEmpty () || "=" .equals (value )) {
207
208
throw new SQLException ("Invalid query parameter value in pair '" + pair + "'" );
208
209
}
209
210
properties .put (key .trim (), value );
0 commit comments