org.jclouds.http.HttpResponse.getHeaders()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(7.0k)|赞(0)|评价(0)|浏览(160)

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

HttpResponse.getHeaders介绍

暂无

代码示例

代码示例来源:origin: jclouds/legacy-jclouds

@VisibleForTesting
Map<String, String> extractUserMetadata(HttpResponse from) {
 Map<String, String> metadata = Maps.newHashMap();
 for (Entry<String, String> header : from.getHeaders().entries()) {
   if (header.getKey() != null && header.getKey().startsWith(SwiftHeaders.CONTAINER_METADATA_PREFIX))
    metadata.put((header.getKey().substring(SwiftHeaders.CONTAINER_METADATA_PREFIX.length())).toLowerCase(),
       header.getValue());
 }
 return metadata;
}

代码示例来源:origin: org.apache.jclouds.api/swift

@VisibleForTesting
Map<String, String> extractUserMetadata(HttpResponse from) {
 Map<String, String> metadata = Maps.newHashMap();
 for (Entry<String, String> header : from.getHeaders().entries()) {
   if (header.getKey() != null && header.getKey().startsWith(SwiftHeaders.CONTAINER_METADATA_PREFIX))
    metadata.put((header.getKey().substring(SwiftHeaders.CONTAINER_METADATA_PREFIX.length())).toLowerCase(),
       header.getValue());
 }
 return metadata;
}

代码示例来源:origin: jclouds/legacy-jclouds

public Boolean apply(HttpResponse from) {
   checkNotNull(from, "http response");
   return from.getHeaders().containsEntry("x-emc-groupacl", "other=READ");
  }
}

代码示例来源:origin: org.apache.jclouds.api/openstack-swift

@Override
  public Map<String, String> apply(HttpResponse from) {
   return EntriesWithoutMetaPrefix.INSTANCE.apply(from.getHeaders());
  }
}

代码示例来源:origin: org.jclouds.provider/hpcloud-objectstorage-lvs

@VisibleForTesting
void addUserMetadataTo(HttpResponse from, ContainerMetadata metadata) {
 for (Entry<String, String> header : from.getHeaders().entries()) {
   if (header.getKey() != null && header.getKey().startsWith(SwiftHeaders.CONTAINER_METADATA_PREFIX))
    metadata.getMetadata().put((header.getKey().substring(SwiftHeaders.CONTAINER_METADATA_PREFIX.length())).toLowerCase(),
       header.getValue());
 }
}

代码示例来源:origin: Nextdoor/bender

@Override
  public Map<String, String> apply(HttpResponse from) {
   return EntriesWithoutMetaPrefix.INSTANCE.apply(from.getHeaders());
  }
}

代码示例来源:origin: Nextdoor/bender

@VisibleForTesting
void addUserMetadataTo(HttpResponse from, MutableBlobMetadata metadata) {
 for (Entry<String, String> header : from.getHeaders().entries()) {
   if (header.getKey() != null && header.getKey().startsWith(metadataPrefix))
    metadata.getUserMetadata().put((header.getKey().substring(metadataPrefix.length())).toLowerCase(),
         header.getValue());
 }
}

代码示例来源:origin: io.cloudsoft.jclouds/jclouds-blobstore

@VisibleForTesting
void addUserMetadataTo(HttpResponse from, MutableBlobMetadata metadata) {
 for (Entry<String, String> header : from.getHeaders().entries()) {
   if (header.getKey() != null && header.getKey().startsWith(metadataPrefix))
    metadata.getUserMetadata().put((header.getKey().substring(metadataPrefix.length())).toLowerCase(),
         header.getValue());
 }
}

代码示例来源:origin: jclouds/legacy-jclouds

@Override
  public LoginResponse apply(HttpResponse response) {
   checkNotNull(response, "response");

   LoginResponse login =  parser.apply(response);
   checkNotNull(login, "loginResponse");

   String jSessionId = get(Splitter.on("=").split(get(Splitter.on(";").trimResults().split(
     getOnlyElement(response.getHeaders().get("Set-Cookie"))), 0)), 1);
   
   return LoginResponse.builder().fromLoginResponse(login).jSessionId(jSessionId).build();
  }
}

代码示例来源:origin: jclouds/legacy-jclouds

public Blob apply(HttpResponse from) {
 checkNotNull(from, "request");
 MutableBlobMetadata metadata = metadataParser.apply(from);
 Blob blob = blobFactory.create(metadata);
 blob.getAllHeaders().putAll(from.getHeaders());
 blob.setPayload(from.getPayload());
 return blob;
}

代码示例来源:origin: io.cloudsoft.jclouds/jclouds-blobstore

public Blob apply(HttpResponse from) {
 checkNotNull(from, "request");
 MutableBlobMetadata metadata = metadataParser.apply(from);
 Blob blob = blobFactory.create(metadata);
 blob.getAllHeaders().putAll(from.getHeaders());
 blob.setPayload(from.getPayload());
 return blob;
}

代码示例来源:origin: com.amysta.jclouds/jclouds-blobstore

public Blob apply(HttpResponse from) {
 checkNotNull(from, "request");
 MutableBlobMetadata metadata = metadataParser.apply(from);
 Blob blob = blobFactory.create(metadata);
 blob.getAllHeaders().putAll(from.getHeaders());
 blob.setPayload(from.getPayload());
 return blob;
}

代码示例来源:origin: org.apache.jclouds/jclouds-blobstore

public Blob apply(HttpResponse from) {
 checkNotNull(from, "request");
 MutableBlobMetadata metadata = metadataParser.apply(from);
 Blob blob = blobFactory.create(metadata);
 blob.getAllHeaders().putAll(from.getHeaders());
 blob.setPayload(from.getPayload());
 return blob;
}

代码示例来源:origin: org.jclouds/jclouds-blobstore

public Blob apply(HttpResponse from) {
 checkNotNull(from, "request");
 MutableBlobMetadata metadata = metadataParser.apply(from);
 Blob blob = blobFactory.create(metadata);
 blob.getAllHeaders().putAll(from.getHeaders());
 blob.setPayload(from.getPayload());
 return blob;
}

代码示例来源:origin: Nextdoor/bender

public Blob apply(HttpResponse from) {
 checkNotNull(from, "request");
 MutableBlobMetadata metadata = metadataParser.apply(from);
 Blob blob = blobFactory.create(metadata);
 blob.getAllHeaders().putAll(from.getHeaders());
 blob.setPayload(from.getPayload());
 return blob;
}

代码示例来源:origin: org.jclouds/jclouds-azure

public AzureBlob apply(HttpResponse from) {
 MutableBlobProperties metadata = metadataParser.apply(from);
 AzureBlob blob = blobFactory.create(metadata);
 blob.getAllHeaders().putAll(from.getHeaders());
 blob.setPayload(from.getPayload());
 return blob;
}

代码示例来源:origin: org.jclouds/jclouds-aws

public S3Object apply(HttpResponse from) {
 MutableObjectMetadata metadata = metadataParser.apply(from);
 S3Object object = objectProvider.create(metadata);
 object.getAllHeaders().putAll(from.getHeaders());
 object.setPayload(from.getPayload());
 return object;
}

代码示例来源:origin: org.jclouds.api/s3

public S3Object apply(HttpResponse from) {
 MutableObjectMetadata metadata = metadataParser.apply(from);
 S3Object object = objectProvider.create(metadata);
 object.getAllHeaders().putAll(from.getHeaders());
 object.setPayload(from.getPayload());
 return object;
}

代码示例来源:origin: org.apache.jclouds.api/openstack-swift

@Override
  public Account apply(HttpResponse from) {
   return Account.builder()
      .bytesUsed(Long.parseLong(from.getFirstHeaderOrNull(ACCOUNT_BYTES_USED)))
      .containerCount(Long.parseLong(from.getFirstHeaderOrNull(ACCOUNT_CONTAINER_COUNT)))
      .objectCount(Long.parseLong(from.getFirstHeaderOrNull(ACCOUNT_OBJECT_COUNT)))
      .metadata(EntriesWithoutMetaPrefix.INSTANCE.apply(from.getHeaders())).build();
  }
}

代码示例来源:origin: jclouds/legacy-jclouds

public SwiftObject apply(HttpResponse from) {
 MutableObjectInfoWithMetadata metadata = infoParser.apply(from);
 if (metadata.getHash() != null)
   from.getPayload().getContentMetadata().setContentMD5(metadata.getHash());
 SwiftObject object = objectProvider.create(metadata);
 object.getAllHeaders().putAll(from.getHeaders());
 object.setPayload(from.getPayload());
 return object;
}

相关文章