Merge commit '8d950286588c2784b75f88a72132ace4ef987c4d' into develop

* commit '8d950286588c2784b75f88a72132ace4ef987c4d':
  fix: IDEA 导入的时候总是会将编译level变成5.0的问题
  #165 #167
  #165 MediaDownloadRequestExecutor出错后就没有办法下载了
  upgrade version 1.1.8-SNAPSHOT
  update
  upgrade to 1.1.7
This commit is contained in:
ukid
2015-07-14 18:02:39 +08:00
11 changed files with 74 additions and 55 deletions

View File

@@ -47,20 +47,21 @@ public class QrCodeRequestExecutor implements RequestExecutor<File, WxMpQrCodeTi
httpGet.setConfig(config);
}
CloseableHttpResponse response = httpclient.execute(httpGet);
Header[] contentTypeHeader = response.getHeaders("Content-Type");
if (contentTypeHeader != null && contentTypeHeader.length > 0) {
// 出错
if (ContentType.TEXT_PLAIN.getMimeType().equals(contentTypeHeader[0].getValue())) {
String responseContent = Utf8ResponseHandler.INSTANCE.handleResponse(response);
throw new WxErrorException(WxError.fromJson(responseContent));
try (CloseableHttpResponse response = httpclient.execute(httpGet)) {
Header[] contentTypeHeader = response.getHeaders("Content-Type");
if (contentTypeHeader != null && contentTypeHeader.length > 0) {
// 出错
if (ContentType.TEXT_PLAIN.getMimeType().equals(contentTypeHeader[0].getValue())) {
String responseContent = Utf8ResponseHandler.INSTANCE.handleResponse(response);
throw new WxErrorException(WxError.fromJson(responseContent));
}
}
InputStream inputStream = InputStreamResponseHandler.INSTANCE.handleResponse(response);
File localFile = FileUtils.createTmpFile(inputStream, UUID.randomUUID().toString(), "jpg");
return localFile;
}
InputStream inputStream = InputStreamResponseHandler.INSTANCE.handleResponse(response);
File localFile = FileUtils.createTmpFile(inputStream, UUID.randomUUID().toString(), "jpg");
return localFile;
}
}