Title: 文件上传接口优化,添加支持是否关闭io流的方法 · Issue #591 · binarywang/WxJava · GitHub
Open Graph Title: 文件上传接口优化,添加支持是否关闭io流的方法 · Issue #591 · binarywang/WxJava
X Title: 文件上传接口优化,添加支持是否关闭io流的方法 · Issue #591 · binarywang/WxJava
Description: @binarywang 在进行批量公众账号图文素材上传的过程中,需要频繁的对一个文件进行读取操作, 发现下次循环的时候,io流已经关闭.希望优化方法 WxMpMaterialServiceImpl @Override public WxMediaUploadResult mediaUpload(String mediaType, String fileType, InputStream inputStream) throws WxErrorException { Fil...
Open Graph Description: @binarywang 在进行批量公众账号图文素材上传的过程中,需要频繁的对一个文件进行读取操作, 发现下次循环的时候,io流已经关闭.希望优化方法 WxMpMaterialServiceImpl @Override public WxMediaUploadResult mediaUpload(String mediaType, String fileType, InputStream in...
X Description: @binarywang 在进行批量公众账号图文素材上传的过程中,需要频繁的对一个文件进行读取操作, 发现下次循环的时候,io流已经关闭.希望优化方法 WxMpMaterialServiceImpl @Override public WxMediaUploadResult mediaUpload(String mediaType, String fileType, InputStream in...
Opengraph URL: https://github.com/binarywang/WxJava/issues/591
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"文件上传接口优化,添加支持是否关闭io流的方法","articleBody":"@binarywang \r\n在进行批量公众账号图文素材上传的过程中,需要频繁的对一个文件进行读取操作, 发现下次循环的时候,io流已经关闭.希望优化方法\r\nWxMpMaterialServiceImpl\r\n```\r\n @Override\r\n public WxMediaUploadResult mediaUpload(String mediaType, String fileType, InputStream inputStream) throws WxErrorException {\r\n File tmpFile = null;\r\n try {\r\n tmpFile = FileUtils.createTmpFile(inputStream, UUID.randomUUID().toString(), fileType);\r\n return this.mediaUpload(mediaType, tmpFile);\r\n } catch (IOException e) {\r\n throw new WxErrorException(WxError.builder().errorCode(-1).errorMsg(e.getMessage()).build(), e);\r\n } finally {\r\n if (tmpFile != null) {\r\n tmpFile.delete();\r\n }\r\n }\r\n }\r\n/* *\r\n* 优化新增方法\r\n*/\r\n public WxMediaUploadResult mediaUpload(String mediaType, String fileType, InputStream inputStream, boolean isCloseStream) throws WxErrorException {\r\n File tmpFile = null;\r\n try {\r\n tmpFile = FileUtils.createTmpFile(inputStream, UUID.randomUUID().toString(), fileType);\r\n return this.mediaUpload(mediaType, tmpFile);\r\n } catch (IOException e) {\r\n throw new WxErrorException(WxError.builder().errorCode(-1).errorMsg(e.getMessage()).build(), e);\r\n } finally {\r\n if (tmpFile != null) {\r\n tmpFile.delete();\r\n }\r\n }\r\n }\r\n```","author":{"url":"https://github.com/15838028035","@type":"Person","name":"15838028035"},"datePublished":"2018-05-16T01:41:08.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/591/WxJava/issues/591"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:01d54973-ae8e-dd59-281c-437677063a64 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B978:15DFF5:2440971:317A7BB:696AD1F5 |
| html-safe-nonce | 890e448471bc7cd12a902b90d5f20bd2332c0e5f274b8168304e1d40bf459983 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCOTc4OjE1REZGNToyNDQwOTcxOjMxN0E3QkI6Njk2QUQxRjUiLCJ2aXNpdG9yX2lkIjoiODA1Mjc5NTIxOTI4MDQwOTQ5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 9754d680956a01e7f0a0deba98cacb739da633a49c4cfae45b29436748af71d5 |
| hovercard-subject-tag | issue:323439820 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/binarywang/WxJava/591/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f950268bc6d571bb453a20c25f14297ca7a5fe7b9e94ca3fa4e9fa7a49fa441a/binarywang/WxJava/issues/591 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f950268bc6d571bb453a20c25f14297ca7a5fe7b9e94ca3fa4e9fa7a49fa441a/binarywang/WxJava/issues/591 |
| og:image:alt | @binarywang 在进行批量公众账号图文素材上传的过程中,需要频繁的对一个文件进行读取操作, 发现下次循环的时候,io流已经关闭.希望优化方法 WxMpMaterialServiceImpl @Override public WxMediaUploadResult mediaUpload(String mediaType, String fileType, InputStream in... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | 15838028035 |
| hostname | github.com |
| expected-hostname | github.com |
| None | c785f4ce187e9e7331257791b36ddee01625bb8e292a9b4fe2c16d4c006abf5d |
| turbo-cache-control | no-preview |
| go-import | github.com/binarywang/WxJava git https://github.com/binarywang/WxJava.git |
| octolytics-dimension-user_id | 1343140 |
| octolytics-dimension-user_login | binarywang |
| octolytics-dimension-repository_id | 49122742 |
| octolytics-dimension-repository_nwo | binarywang/WxJava |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49122742 |
| octolytics-dimension-repository_network_root_nwo | binarywang/WxJava |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | c718a376fcf780eb22089171adb84a543f660bf7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width