@@ -126,7 +126,7 @@ private HttpClient getHttpClient(boolean isForMedia) {
126
126
127
127
/**
128
128
* Only one instance is created for the httpClient for optimization.
129
- * A PoolingClientConnectionManager is used with the Http client
129
+ * A PoolingClientConnectionManager is used with the Http client
130
130
* to be able to reuse connections and execute requests concurrently.
131
131
* A timeout for closing each connection is set so that connections don't leak.
132
132
* A timeout is set for requests to avoid deadlocks.
@@ -153,11 +153,11 @@ private void putMoreContentIntoDocumentServiceRequest(
153
153
String httpMethod ) {
154
154
if (this .masterKey != null ) {
155
155
final Date currentTime = new Date ();
156
- final SimpleDateFormat sdf =
157
- new SimpleDateFormat ("E, dd MMM YYY HH:mm:ss z" );
156
+ final SimpleDateFormat sdf =
157
+ new SimpleDateFormat ("E, dd MMM yyyy HH:mm:ss z" );
158
158
sdf .setTimeZone (TimeZone .getTimeZone ("GMT" ));
159
159
String xDate = sdf .format (currentTime );
160
-
160
+
161
161
request .getHeaders ().put (HttpConstants .HttpHeaders .X_DATE , xDate );
162
162
}
163
163
@@ -209,7 +209,7 @@ private void fillHttpRequestBaseWithHeaders(Map<String, String> headers, HttpReq
209
209
210
210
private void maybeThrowException (HttpResponse response ) throws DocumentClientException {
211
211
int statusCode = response .getStatusLine ().getStatusCode ();
212
-
212
+
213
213
if (statusCode >= HttpConstants .StatusCodes .MINIMUM_STATUSCODE_AS_ERROR_GATEWAY ) {
214
214
HttpEntity httpEntity = response .getEntity ();
215
215
String body = "" ;
@@ -263,7 +263,7 @@ private DocumentServiceResponse performDeleteRequest(
263
263
}
264
264
265
265
this .maybeThrowException (response );
266
-
266
+
267
267
// No content in delete request, we can release the connection directly;
268
268
httpDelete .releaseConnection ();
269
269
return new DocumentServiceResponse (response );
@@ -282,7 +282,7 @@ private DocumentServiceResponse performGetRequest(DocumentServiceRequest request
282
282
null , // Query string not used.
283
283
null );
284
284
} catch (URISyntaxException e ) {
285
- throw new IllegalArgumentException ("Incorrect uri from request." ,
285
+ throw new IllegalArgumentException ("Incorrect uri from request." ,
286
286
e );
287
287
}
288
288
0 commit comments