@Test(dependsOnMethods = {"testUploadMedia"}, dataProvider = "downloadMedia") public void testDownloadMedia(String mediaId) throws WxErrorException { File file = this.wxService.getMaterialService().mediaDownload(mediaId); assertNotNull(file); System.out.println(file.getAbsolutePath()); }
@Override public File mediaDownload(String mediaId) throws WxErrorException { return this.wxMpService.execute( BaseMediaDownloadRequestExecutor.create(this.wxMpService.getRequestHttp(), this.wxMpService.getWxMpConfigStorage().getTmpDirFile()), MEDIA_GET_URL, "media_id=" + mediaId); }
WxMpMaterialServiceImpl implements WxMpMaterialService { @Override public File mediaDownload(String mediaId) throws WxErrorException { return this.wxMpService.execute( BaseMediaDownloadRequestExecutor.create(this.wxMpService.getRequestHttp(), this.wxMpService.getWxMpConfigStorage().getTmpDirFile()), MEDIA_GET_URL, "media_id=" + mediaId); } }
WxMpMaterialServiceImpl implements WxMpMaterialService { @Override public File mediaDownload(String mediaId) throws WxErrorException { return this.wxMpService.execute( BaseMediaDownloadRequestExecutor.create(this.wxMpService.getRequestHttp(), this.wxMpService.getWxMpConfigStorage().getTmpDirFile()), MEDIA_GET_URL, "media_id=" + mediaId); } WxMpMaterialServiceImpl(WxMpService wxMpService); }
WxMpMaterialServiceImpl implements WxMpMaterialService { @Override public File mediaDownload(String mediaId) throws WxErrorException { return this.wxMpService.execute( BaseMediaDownloadRequestExecutor.create(this.wxMpService.getRequestHttp(), this.wxMpService.getWxMpConfigStorage().getTmpDirFile()), MEDIA_GET_URL, "media_id=" + mediaId); } WxMpMaterialServiceImpl(WxMpService wxMpService); @Override WxMediaUploadResult mediaUpload(String mediaType, String fileType, InputStream inputStream); @Override WxMediaUploadResult mediaUpload(String mediaType, File file); @Override File mediaDownload(String mediaId); @Override WxMediaImgUploadResult mediaImgUpload(File file); @Override WxMpMaterialUploadResult materialFileUpload(String mediaType, WxMpMaterial material); @Override WxMpMaterialUploadResult materialNewsUpload(WxMpMaterialNews news); @Override InputStream materialImageOrVoiceDownload(String mediaId); @Override WxMpMaterialVideoInfoResult materialVideoInfo(String mediaId); @Override WxMpMaterialNews materialNewsInfo(String mediaId); @Override boolean materialNewsUpdate(WxMpMaterialArticleUpdate wxMpMaterialArticleUpdate); @Override boolean materialDelete(String mediaId); @Override WxMpMaterialCountResult materialCount(); @Override WxMpMaterialNewsBatchGetResult materialNewsBatchGet(int offset, int count); @Override WxMpMaterialFileBatchGetResult materialFileBatchGet(String type, int offset, int count); }
WxMpMaterialServiceImpl implements WxMpMaterialService { @Override public File mediaDownload(String mediaId) throws WxErrorException { return this.wxMpService.execute( BaseMediaDownloadRequestExecutor.create(this.wxMpService.getRequestHttp(), this.wxMpService.getWxMpConfigStorage().getTmpDirFile()), MEDIA_GET_URL, "media_id=" + mediaId); } WxMpMaterialServiceImpl(WxMpService wxMpService); @Override WxMediaUploadResult mediaUpload(String mediaType, String fileType, InputStream inputStream); @Override WxMediaUploadResult mediaUpload(String mediaType, File file); @Override File mediaDownload(String mediaId); @Override WxMediaImgUploadResult mediaImgUpload(File file); @Override WxMpMaterialUploadResult materialFileUpload(String mediaType, WxMpMaterial material); @Override WxMpMaterialUploadResult materialNewsUpload(WxMpMaterialNews news); @Override InputStream materialImageOrVoiceDownload(String mediaId); @Override WxMpMaterialVideoInfoResult materialVideoInfo(String mediaId); @Override WxMpMaterialNews materialNewsInfo(String mediaId); @Override boolean materialNewsUpdate(WxMpMaterialArticleUpdate wxMpMaterialArticleUpdate); @Override boolean materialDelete(String mediaId); @Override WxMpMaterialCountResult materialCount(); @Override WxMpMaterialNewsBatchGetResult materialNewsBatchGet(int offset, int count); @Override WxMpMaterialFileBatchGetResult materialFileBatchGet(String type, int offset, int count);  }