@Test public void testParseNetworkResponse() throws UnsupportedEncodingException { final Map<String, String> headers = new HashMap<>(); headers.put(CONTENT_TYPE, "text/plain; charset=" + CHARSET); final NetworkResponse networkResponse = new NetworkResponse(RESPONSE.getBytes(CHARSET), headers); final Response<String> response = request.parseNetworkResponse(networkResponse); assertEquals(RESPONSE, response.result); }
@Override protected Response<String> parseNetworkResponse(final NetworkResponse response) { try { final String str = new String(response.data, HttpHeaderParser.parseCharset(response.headers)); return Response.success(str, HttpHeaderParser.parseCacheHeaders(response)); } catch (final UnsupportedEncodingException e) { return Response.error(new ParseError(e)); } }
UploadBitmapRfcCompliantListenableRequest extends
				RfcCompliantListenableRequest<String> { @Override protected Response<String> parseNetworkResponse(final NetworkResponse response) { try { final String str = new String(response.data, HttpHeaderParser.parseCharset(response.headers)); return Response.success(str, HttpHeaderParser.parseCacheHeaders(response)); } catch (final UnsupportedEncodingException e) { return Response.error(new ParseError(e)); } } }
UploadBitmapRfcCompliantListenableRequest extends
				RfcCompliantListenableRequest<String> { @Override protected Response<String> parseNetworkResponse(final NetworkResponse response) { try { final String str = new String(response.data, HttpHeaderParser.parseCharset(response.headers)); return Response.success(str, HttpHeaderParser.parseCacheHeaders(response)); } catch (final UnsupportedEncodingException e) { return Response.error(new ParseError(e)); } } @SuppressWarnings("checkstyle:magicnumber")  UploadBitmapRfcCompliantListenableRequest(final int method, @NonNull final String url,
						@Nullable final Listener<String> listener,
						@Nullable final ErrorListener errListener,
						@Nullable final CancelListener cancelListener,
						@NonNull final Bitmap bmp, @NonNull final String filename);  UploadBitmapRfcCompliantListenableRequest(final int method, @NonNull final String url,
					@Nullable final Listener<String> listener,
					@Nullable final ErrorListener errListener,
					@NonNull final Bitmap bmp, @NonNull final String filename); }
UploadBitmapRfcCompliantListenableRequest extends
				RfcCompliantListenableRequest<String> { @Override protected Response<String> parseNetworkResponse(final NetworkResponse response) { try { final String str = new String(response.data, HttpHeaderParser.parseCharset(response.headers)); return Response.success(str, HttpHeaderParser.parseCacheHeaders(response)); } catch (final UnsupportedEncodingException e) { return Response.error(new ParseError(e)); } } @SuppressWarnings("checkstyle:magicnumber")  UploadBitmapRfcCompliantListenableRequest(final int method, @NonNull final String url,
						@Nullable final Listener<String> listener,
						@Nullable final ErrorListener errListener,
						@Nullable final CancelListener cancelListener,
						@NonNull final Bitmap bmp, @NonNull final String filename);  UploadBitmapRfcCompliantListenableRequest(final int method, @NonNull final String url,
					@Nullable final Listener<String> listener,
					@Nullable final ErrorListener errListener,
					@NonNull final Bitmap bmp, @NonNull final String filename); @Override String getBodyContentType(); @SuppressWarnings("checkstyle:magicnumber") @SuppressFBWarnings(value = { "DM_DEFAULT_ENCODING", "MDM_STRING_BYTES_ENCODING", "VA_FORMAT_STRING_USES_NEWLINE" }, justification = "The encoding will be sent with the headers automatically." + " The protocol requires \\r\\n, independently on the platform") @Override byte[] getBody(); @Override String toString(); }
UploadBitmapRfcCompliantListenableRequest extends
				RfcCompliantListenableRequest<String> { @Override protected Response<String> parseNetworkResponse(final NetworkResponse response) { try { final String str = new String(response.data, HttpHeaderParser.parseCharset(response.headers)); return Response.success(str, HttpHeaderParser.parseCacheHeaders(response)); } catch (final UnsupportedEncodingException e) { return Response.error(new ParseError(e)); } } @SuppressWarnings("checkstyle:magicnumber")  UploadBitmapRfcCompliantListenableRequest(final int method, @NonNull final String url,
						@Nullable final Listener<String> listener,
						@Nullable final ErrorListener errListener,
						@Nullable final CancelListener cancelListener,
						@NonNull final Bitmap bmp, @NonNull final String filename);  UploadBitmapRfcCompliantListenableRequest(final int method, @NonNull final String url,
					@Nullable final Listener<String> listener,
					@Nullable final ErrorListener errListener,
					@NonNull final Bitmap bmp, @NonNull final String filename); @Override String getBodyContentType(); @SuppressWarnings("checkstyle:magicnumber") @SuppressFBWarnings(value = { "DM_DEFAULT_ENCODING", "MDM_STRING_BYTES_ENCODING", "VA_FORMAT_STRING_USES_NEWLINE" }, justification = "The encoding will be sent with the headers automatically." + " The protocol requires \\r\\n, independently on the platform") @Override byte[] getBody(); @Override String toString();  }