code: public static File downloadMedia(String accessToken, String mediaId) {
          String url = "http://file.api.weixin.qq.com/cgi-bin/media/get?access_token="
                       + accessToken
                       + "&media_id="
                       + mediaId;
          File mf = null;
          for (int i = 0; i < 3; i++) {
              InputStream in = null;
              OutputStream out = null;
              try {
                  Response resp = Http.get(url, 60 * 1000);
                  if (resp.isOK()) {
                      in = resp.getStream();
                      mf = File.createTempFile(mediaId, ".wxmedia");
                      out = new FileOutputStream(mf);
                      Streams.writeAndClose(out, in);
                      // 检查一下是不是报错
                      if (mf.length() < 128) {
                          byte[] data = Files.readBytes(mf);
                          if (data[0] == '{') { // 看上去是个json,悲催了...
                              // 多媒体文件怎么可能是{开头,抛错吧
                              throw new IllegalArgumentException("mediaId="
                                                                 + mediaId
                                                                 + ","
                                                                 + new String(data));
                          }
                      }
                      log.debugf("media download success mediaId=" + mediaId);
                      break;
                  } else {}
              }
              catch (Throwable e) {
                  log.infof("download %s fail", mediaId, e);
              }
              finally {
                  Streams.safeClose(in);
                  Streams.safeClose(out);
              }
          }
          return mf;
      }
docs: 下载媒体文件(放到临时目录中), 返回对应文件
  
  @param accessToken
  @param mediaId