okhttp3/Callback请问大神jar包是不是导错了
博彩导航网站排行榜
博彩导航网站排行榜
当前位置 : 博彩导航网站排行榜 > 博彩导航网站排行榜

okhttp3/Callback请问大神jar包是不是导错了

按照官网给的例子,
jar包:okhttp-2.3.0-SNAPSHOT.jar okio-1.3.0-SNAPSHOT.jar

   qiniu-java-sdk-7.10.jar    qiniu-java-sdk-7.10-sources.jar
   gson-2.2.1.jar

上传回调方法如下:
public class qiniuUploadAction {

 //设置好账号的ACCESS_KEY和SECRET_KEY
  String ACCESS_KEY = "l7TEvUA-XlHQuZBZrLkRhbEi2syozzsGmgKa0ZBv";
  String SECRET_KEY = "F2bAE9PJCIzL7pLMqnXfY_mQd-l3kmDRdKpl3eWn";
  //要上传的空间
  String bucketname = "image20160623";
  //上传到七牛后保存的文件名
  String key = "my-java.png";
  //上传文件的路径
  String FilePath = "http://127.0.0.1:8080/wcmsadmin/upload/20160313143057.jpg";

  //密钥配置
  Auth auth = Auth.createACCESS_KEY, SECRET_KEY;
  //创建上传对象
  UploadManager uploadManager = new UploadManager;

  //设置callbackUrl以及callbackBody,七牛将文件名和文件大小回调给业务服务器
  public String getUpToken{
      return auth.uploadTokenbucketname,null,3600,new StringMap
          .put"callbackUrl","http://your.domain.com/callback"
          .put"callbackBody", "filename=$fname&filesize=$fsize";
  }

  public void upload throws IOException{
    try {
      //调用put方法上传
      Response res = uploadManager.putFilePath, null, getUpToken;
      //打印返回的信息
      System.out.printlnres.bodyString; 
      } catch QiniuException e {
          Response r = e.response;
          // 请求失败时打印的异常的信息
          System.out.printlnr.toString;
          try {
              //响应的文本信息
            System.out.printlnr.bodyString;
          } catch QiniuException e1 {
              //ignore
          }
      }       
  }

  public static void mainString args[] throws IOException{  
      qiniuUploadAction ss =new qiniuUploadAction;
      ss.upload;
  }

}

运行报错:

请各位大神,指点迷津,谢谢

你导的包是okhttp2.x的,得用okhttp3

最新文章

广告位

博彩导航网站排行榜