我用七牛提供的jar包,引进去始终提示这样的错误。都无语了
有大神指导 指导吗?
认证高级PHP讲师
public static String getWebUptoken() { Config.ACCESS_KEY = PropertiesUtil.getString("qiniu.access.key"); Config.SECRET_KEY = PropertiesUtil.getString("qiniu.secret.key"); Mac mac = new Mac(Config.ACCESS_KEY, Config.SECRET_KEY); // 请确保该bucket已经存在 String bucketName = PropertiesUtil.getString("qiniu.bucket"); PutPolicy putPolicy = new PutPolicy(bucketName); Calendar cal = Calendar.getInstance(); cal.add(Calendar.HOUR_OF_DAY, 1); putPolicy.deadline = cal.getTimeInMillis() / 1000; String uptoken = null; try { uptoken = putPolicy.token(mac); } catch (AuthException e) { e.printStackTrace(); } catch (JSONException e) { e.printStackTrace(); } return uptoken;
I also encountered the same problem. Could you please tell me how you solved it?
I also encountered the same problem. Could you please tell me how you solved it?