org.jclouds.rest.HttpClient.exists()方法的使用及代码示例

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

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

HttpClient.exists介绍

暂无

代码示例

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

@Test(enabled = true, dependsOnMethods = "testRegisterTemplate")
public void testExtractTemplate() throws Exception {
 // Initiate the extraction and wait for it to complete
 AsyncCreateResponse response = client.getTemplateClient().extractTemplate(registeredTemplate.getId(), ExtractMode.HTTP_DOWNLOAD, registeredTemplate.getZoneId());
 assertTrue(jobComplete.apply(response.getJobId()), registeredTemplate.toString());
 // Get the result
 AsyncJob<TemplateExtraction> asyncJob = client.getAsyncJobClient().getAsyncJob(response.getJobId());
 TemplateExtraction extract = asyncJob.getResult();
 assertNotNull(extract);
 // Check that the URL can be retrieved
 String extractUrl = extract.getUrl();
 assertNotNull(extractUrl);
 URI uri = new URI(URLDecoder.decode(extractUrl, "utf-8"));
 assertTrue(cloudStackContext.utils().http().exists(uri), "does not exist: " + uri);
}

代码示例来源:origin: apache/jclouds

@Test(enabled = true, dependsOnMethods = "testRegisterTemplate")
public void testExtractTemplate() throws Exception {
 // Initiate the extraction and wait for it to complete
 AsyncCreateResponse response = client.getTemplateApi().extractTemplate(registeredTemplate.getId(), ExtractMode.HTTP_DOWNLOAD, registeredTemplate.getZoneId());
 assertTrue(jobComplete.apply(response.getJobId()), registeredTemplate.toString());
 // Get the result
 AsyncJob<TemplateExtraction> asyncJob = client.getAsyncJobApi().getAsyncJob(response.getJobId());
 TemplateExtraction extract = asyncJob.getResult();
 assertNotNull(extract);
 // Check that the URL can be retrieved
 String extractUrl = extract.getUrl();
 assertNotNull(extractUrl);
 URI uri = new URI(URLDecoder.decode(extractUrl, "utf-8"));
 assertTrue(cloudStackContext.utils().http().exists(uri), "does not exist: " + uri);
}

相关文章