Commit 90c29240e06bebfb0f7825f1e9a3a790232ca54d
1 parent
c62c66ed
去除调试日志
Showing
1 changed file
with
3 additions
and
8 deletions
src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRESTfulUtils.java
| @@ -134,18 +134,13 @@ public class ZLMRESTfulUtils { | @@ -134,18 +134,13 @@ public class ZLMRESTfulUtils { | ||
| 134 | } | 134 | } |
| 135 | File snapFile = new File(targetPath + "/" + fileName); | 135 | File snapFile = new File(targetPath + "/" + fileName); |
| 136 | FileOutputStream outStream = new FileOutputStream(snapFile); | 136 | FileOutputStream outStream = new FileOutputStream(snapFile); |
| 137 | - ResponseBody responseBody = response.body(); | ||
| 138 | - if (responseBody != null) { | ||
| 139 | - outStream.write(responseBody.bytes()); | ||
| 140 | - } | 137 | + |
| 138 | + outStream.write(Objects.requireNonNull(response.body()).bytes()); | ||
| 141 | outStream.close(); | 139 | outStream.close(); |
| 142 | } else { | 140 | } else { |
| 143 | logger.error(String.format("[ %s ]请求失败: %s %s", url, response.code(), response.message())); | 141 | logger.error(String.format("[ %s ]请求失败: %s %s", url, response.code(), response.message())); |
| 144 | } | 142 | } |
| 145 | - ResponseBody responseBody = response.body(); | ||
| 146 | - if (responseBody != null) { | ||
| 147 | - responseBody.close(); | ||
| 148 | - } | 143 | + Objects.requireNonNull(response.body()).close(); |
| 149 | } else { | 144 | } else { |
| 150 | logger.error(String.format("[ %s ]请求失败: %s %s", url, response.code(), response.message())); | 145 | logger.error(String.format("[ %s ]请求失败: %s %s", url, response.code(), response.message())); |
| 151 | } | 146 | } |