@@ -48,7 +48,7 @@ public static final void validateSupportedScheme(URI uri) {
48
48
}
49
49
}
50
50
51
- public final static URI createUri (String u ) {
51
+ public final static URI createNonEmptyPathURI (String u ) {
52
52
URI uri = URI .create (u );
53
53
validateSupportedScheme (uri );
54
54
@@ -64,10 +64,6 @@ public final static URI createUri(String u) {
64
64
return uri ;
65
65
}
66
66
67
- public static String getBaseUrl (String url ) {
68
- return getBaseUrl (createUri (url ));
69
- }
70
-
71
67
public final static String getBaseUrl (URI uri ) {
72
68
String url = uri .getScheme () + "://" + uri .getAuthority ();
73
69
int port = uri .getPort ();
@@ -202,8 +198,7 @@ public static String parseCharset(String contentType) {
202
198
// Quite a lot of sites have charset="CHARSET",
203
199
// e.g. charset="utf-8". Note the quotes. This is
204
200
// not correct, but client should be able to handle
205
- // it (all browsers do, Apache HTTP Client and Grizzly
206
- // strip it by default)
201
+ // it (all browsers do, Grizzly strips it by default)
207
202
// This is a poor man's trim("\"").trim("'")
208
203
return charset .replaceAll ("\" " , "" ).replaceAll ("'" , "" );
209
204
}
@@ -212,11 +207,6 @@ public static String parseCharset(String contentType) {
212
207
return null ;
213
208
}
214
209
215
- public static int secondsFromNow (long timeMillis ) {
216
- long maxAgeMillis = timeMillis - System .currentTimeMillis ();
217
- return (int ) (maxAgeMillis / 1000 ) + (maxAgeMillis % 1000 != 0 ? 1 : 0 );
218
- }
219
-
220
210
public static String keepAliveHeaderValue (AsyncHttpClientConfig config ) {
221
211
return config .getAllowPoolingConnection () ? "keep-alive" : "close" ;
222
212
}
0 commit comments