mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-08-20 00:44:25 +08:00
parent
3537381d89
commit
ac405b0bc2
3
.gitignore
vendored
3
.gitignore
vendored
@ -53,3 +53,6 @@ sonar-project.properties
|
||||
|
||||
!/.mvn/wrapper/maven-wrapper.jar
|
||||
*.versionsBackup
|
||||
|
||||
# STS
|
||||
.factorypath
|
||||
|
@ -58,7 +58,7 @@ public class HttpResponseProxy {
|
||||
private String getFileName(CloseableHttpResponse response) throws WxErrorException {
|
||||
Header[] contentDispositionHeader = response.getHeaders("Content-disposition");
|
||||
if (contentDispositionHeader == null || contentDispositionHeader.length == 0) {
|
||||
throw new WxErrorException(WxError.builder().errorMsg("无法获取到文件名").build());
|
||||
throw new WxErrorException(WxError.builder().errorMsg("无法获取到文件名").errorCode(99999).build());
|
||||
}
|
||||
|
||||
return this.extractFileNameFromContentString(contentDispositionHeader[0].getValue());
|
||||
@ -76,7 +76,7 @@ public class HttpResponseProxy {
|
||||
|
||||
private String extractFileNameFromContentString(String content) throws WxErrorException {
|
||||
if (content == null || content.length() == 0) {
|
||||
throw new WxErrorException(WxError.builder().errorMsg("无法获取到文件名").build());
|
||||
throw new WxErrorException(WxError.builder().errorMsg("无法获取到文件名").errorCode(99999).build());
|
||||
}
|
||||
|
||||
Matcher m = PATTERN.matcher(content);
|
||||
@ -84,7 +84,7 @@ public class HttpResponseProxy {
|
||||
return m.group(1);
|
||||
}
|
||||
|
||||
throw new WxErrorException(WxError.builder().errorMsg("无法获取到文件名").build());
|
||||
throw new WxErrorException(WxError.builder().errorMsg("无法获取到文件名").errorCode(99999).build());
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user