com.qiniu.http.Response.close()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(6.3k)|赞(0)|评价(0)|浏览(79)

本文整理了Java中com.qiniu.http.Response.close方法的一些代码示例,展示了Response.close的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Response.close方法的具体详情如下:
包路径:com.qiniu.http.Response
类名称:Response
方法名:close

Response.close介绍

暂无

代码示例

代码示例来源:origin: Alluxio/alluxio

/**
 * Deletes Object in Qiniu kodo.
 * @param key Object key
 */
public void deleteObject(String key) throws QiniuException {
 com.qiniu.http.Response response = mBucketManager.delete(mBucketName, key);
 response.close();
}
/**

代码示例来源:origin: Alluxio/alluxio

/**
 * Creates empty Object in Qiniu kodo.
 * @param key empty Object key
 */
public void createEmptyObject(String key) throws QiniuException {
 com.qiniu.http.Response response =
   mUploadManager.put(new byte[0], key, mAuth.uploadToken(mBucketName, key));
 response.close();
}
/**

代码示例来源:origin: Alluxio/alluxio

/**
 * Puts Object to Qiniu kodo.
 * @param Key Object key for kodo
 * @param File Alluxio File
 */
public void uploadFile(String Key, File File) throws QiniuException {
 com.qiniu.http.Response response =
   mUploadManager.put(File, Key, mAuth.uploadToken(mBucketName, Key));
 response.close();
}
/**

代码示例来源:origin: qiniu/java-sdk

public QiniuException(Response response) {
  super(response != null ? response.getInfo() : null);
  this.response = response;
  if (response != null) {
    response.close();
  }
}

代码示例来源:origin: com.qiniu/qiniu-java-sdk

public QiniuException(Response response) {
  super(response != null ? response.getInfo() : null);
  this.response = response;
  if (response != null) {
    response.close();
  }
}

代码示例来源:origin: qiniu/java-sdk

public void deleteBucket(String bucketname) throws QiniuException {
  String url = String.format("%s/drop/%s", configuration.rsHost(), bucketname);
  Response res = post(url, null);
  if (!res.isOK()) {
    throw new QiniuException(res);
  }
  res.close();
}

代码示例来源:origin: com.qiniu/qiniu-java-sdk

public void deleteBucket(String bucketname) throws QiniuException {
  String url = String.format("%s/drop/%s", configuration.rsHost(), bucketname);
  Response res = post(url, null);
  if (!res.isOK()) {
    throw new QiniuException(res);
  }
  res.close();
}

代码示例来源:origin: com.qiniu/qiniu-java-sdk

public void setBucketAcl(String bucket, AclType acl) throws QiniuException {
  String url = String.format("%s/private?bucket=%s&private=%s", configuration.ucHost(), bucket, acl.getType());
  Response res = post(url, null);
  if (!res.isOK()) {
    throw new QiniuException(res);
  }
  res.close();
}

代码示例来源:origin: qiniu/java-sdk

public void createBucket(String bucketName, String region) throws QiniuException {
  String url = String.format("%s/mkbucketv2/%s/region/%s", configuration.rsHost(),
      UrlSafeBase64.encodeToString(bucketName), region);
  Response res = post(url, null);
  if (!res.isOK()) {
    throw new QiniuException(res);
  }
  res.close();
}

代码示例来源:origin: qiniu/java-sdk

public void setBucketAcl(String bucket, AclType acl) throws QiniuException {
  String url = String.format("%s/private?bucket=%s&private=%s", configuration.ucHost(), bucket, acl.getType());
  Response res = post(url, null);
  if (!res.isOK()) {
    throw new QiniuException(res);
  }
  res.close();
}

代码示例来源:origin: qiniu/java-sdk

public BucketInfo getBucketInfo(String bucket) throws QiniuException {
  String url = String.format("%s/v2/bucketInfo?bucket=%s", configuration.ucHost(), bucket);
  Response res = post(url, null);
  if (!res.isOK()) {
    throw new QiniuException(res);
  }
  BucketInfo info = res.jsonToObject(BucketInfo.class);
  res.close();
  return info;
}

代码示例来源:origin: qiniu/java-sdk

public void setIndexPage(String bucket, IndexPageType type) throws QiniuException {
  String url = String.format("%s/noIndexPage?bucket=%s&noIndexPage=%s",
      configuration.ucHost(), bucket, type.getType());
  Response res = post(url, null);
  if (!res.isOK()) {
    throw new QiniuException(res);
  }
  res.close();
}

代码示例来源:origin: qiniu/java-sdk

/**
 * 对于设置了镜像存储的空间,从镜像源站抓取指定名称的资源并存储到该空间中
 * 如果该空间中已存在该名称的资源,则会将镜像源站的资源覆盖空间中相同名称的资源
 *
 * @param bucket 空间名称
 * @param key    文件名称
 * @throws QiniuException
 */
public void prefetch(String bucket, String key) throws QiniuException {
  String resource = encodedEntry(bucket, key);
  String path = String.format("/prefetch/%s", resource);
  Response res = ioPost(bucket, path);
  if (!res.isOK()) {
    throw new QiniuException(res);
  }
  res.close();
}

代码示例来源:origin: com.qiniu/qiniu-java-sdk

public void createBucket(String bucketName, String region) throws QiniuException {
  String url = String.format("%s/mkbucketv2/%s/region/%s", configuration.rsHost(),
      UrlSafeBase64.encodeToString(bucketName), region);
  Response res = post(url, null);
  if (!res.isOK()) {
    throw new QiniuException(res);
  }
  res.close();
}

代码示例来源:origin: com.qiniu/qiniu-java-sdk

public BucketInfo getBucketInfo(String bucket) throws QiniuException {
  String url = String.format("%s/v2/bucketInfo?bucket=%s", configuration.ucHost(), bucket);
  Response res = post(url, null);
  if (!res.isOK()) {
    throw new QiniuException(res);
  }
  BucketInfo info = res.jsonToObject(BucketInfo.class);
  res.close();
  return info;
}

代码示例来源:origin: com.qiniu/qiniu-java-sdk

public void setIndexPage(String bucket, IndexPageType type) throws QiniuException {
  String url = String.format("%s/noIndexPage?bucket=%s&noIndexPage=%s",
      configuration.ucHost(), bucket, type.getType());
  Response res = post(url, null);
  if (!res.isOK()) {
    throw new QiniuException(res);
  }
  res.close();
}

代码示例来源:origin: com.qiniu/qiniu-java-sdk

/**
 * 获取账号下所有空间名称列表
 *
 * @return 空间名称列表
 */
public String[] buckets() throws QiniuException {
  // 获取 bucket 列表 写死用rs.qiniu.com or rs.qbox.me @冯立元
  String url = String.format("%s/buckets", configuration.rsHost());
  Response res = get(url);
  if (!res.isOK()) {
    throw new QiniuException(res);
  }
  String[] buckets = res.jsonToObject(String[].class);
  res.close();
  return buckets;
}

代码示例来源:origin: qiniu/java-sdk

public FileListing listFiles(String bucket, String prefix, String marker, int limit, String delimiter)
    throws QiniuException {
  Response response = listV1(bucket, prefix, marker, limit, delimiter);
  if (!response.isOK()) {
    throw new QiniuException(response);
  }
  FileListing fileListing = response.jsonToObject(FileListing.class);
  response.close();
  return fileListing;
}

代码示例来源:origin: com.qiniu/qiniu-java-sdk

public FileListing listFiles(String bucket, String prefix, String marker, int limit, String delimiter)
    throws QiniuException {
  Response response = listV1(bucket, prefix, marker, limit, delimiter);
  if (!response.isOK()) {
    throw new QiniuException(response);
  }
  FileListing fileListing = response.jsonToObject(FileListing.class);
  response.close();
  return fileListing;
}

代码示例来源:origin: qiniu/java-sdk

/**
 * 获取账号下所有空间名称列表
 *
 * @return 空间名称列表
 */
public String[] buckets() throws QiniuException {
  // 获取 bucket 列表 写死用rs.qiniu.com or rs.qbox.me @冯立元
  String url = String.format("%s/buckets", configuration.rsHost());
  Response res = get(url);
  if (!res.isOK()) {
    throw new QiniuException(res);
  }
  String[] buckets = res.jsonToObject(String[].class);
  res.close();
  return buckets;
}

相关文章