当前位置: 首页>>代码示例>>Java>>正文


Java ApplicationArchive类代码示例

本文整理汇总了Java中org.cloudfoundry.client.lib.archive.ApplicationArchive的典型用法代码示例。如果您正苦于以下问题:Java ApplicationArchive类的具体用法?Java ApplicationArchive怎么用?Java ApplicationArchive使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ApplicationArchive类属于org.cloudfoundry.client.lib.archive包,在下文中一共展示了ApplicationArchive类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: uploadApplication

import org.cloudfoundry.client.lib.archive.ApplicationArchive; //导入依赖的package包/类
@Override
public void uploadApplication(String appName, ApplicationArchive archive, UploadStatusCallback callback) throws IOException {
    Assert.notNull(appName, "AppName must not be null");
    Assert.notNull(archive, "Archive must not be null");
    UUID appId = getAppId(appName);

    if (callback == null) {
        callback = UploadStatusCallback.NONE;
    }
    CloudResources knownRemoteResources = getKnownRemoteResources(archive);
    callback.onCheckResources();
    callback.onMatchedFileNames(knownRemoteResources.getFilenames());
    UploadApplicationPayload payload = new UploadApplicationPayload(archive, knownRemoteResources);
    callback.onProcessMatchedResources(payload.getTotalUncompressedSize());
    HttpEntity<?> entity = generatePartialResourceRequest(payload, knownRemoteResources);
    ResponseEntity<Map<String, Object>> responseEntity = getRestTemplate().exchange(getUrl("/v2/apps/{guid}/bits?async=true"),
        HttpMethod.PUT, entity, new ParameterizedTypeReference<Map<String, Object>>() {
        }, appId);
    processAsyncJob(responseEntity.getBody(), callback);
}
 
开发者ID:SAP,项目名称:cf-java-client-sap,代码行数:21,代码来源:CloudControllerClientImpl.java

示例2: shouldPackOnlyMissingResources

import org.cloudfoundry.client.lib.archive.ApplicationArchive; //导入依赖的package包/类
@Test
public void shouldPackOnlyMissingResources() throws Exception {
    ZipFile zipFile = new ZipFile(SampleProjects.springTravel());
    try {
        ApplicationArchive archive = new ZipApplicationArchive(zipFile);
        CloudResources allResources = new CloudResources(archive);
        List<CloudResource> resources = new ArrayList<CloudResource>(allResources.asList());
        resources.remove(0);
        CloudResources knownRemoteResources = new CloudResources(resources);
        UploadApplicationPayload payload = new UploadApplicationPayload(archive, knownRemoteResources);
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        FileCopyUtils.copy(payload.getInputStream(), bos);
        assertThat(payload.getArchive(), is(archive));
        assertThat(payload.getTotalUncompressedSize(), is(93));
        assertThat(bos.toByteArray().length, is(2451));
    } finally {
        zipFile.close();
    }
}
 
开发者ID:SAP,项目名称:cf-java-client-sap,代码行数:20,代码来源:UploadApplicationPayloadTest.java

示例3: getKnownRemoteResources

import org.cloudfoundry.client.lib.archive.ApplicationArchive; //导入依赖的package包/类
private CloudResources getKnownRemoteResources(ApplicationArchive archive) throws IOException {
    CloudResources archiveResources = new CloudResources(archive);
    String json = JsonUtil.convertToJson(archiveResources);
    HttpHeaders headers = new HttpHeaders();
    headers.setContentType(JsonUtil.JSON_MEDIA_TYPE);
    HttpEntity<String> requestEntity = new HttpEntity<String>(json, headers);
    ResponseEntity<String> responseEntity = getRestTemplate().exchange(getUrl("/v2/resource_match"), HttpMethod.PUT, requestEntity,
        String.class);
    List<CloudResource> cloudResources = JsonUtil.convertJsonToCloudResourceList(responseEntity.getBody());
    return new CloudResources(cloudResources);
}
 
开发者ID:SAP,项目名称:cf-java-client-sap,代码行数:12,代码来源:CloudControllerClientImpl.java

示例4: CloudResources

import org.cloudfoundry.client.lib.archive.ApplicationArchive; //导入依赖的package包/类
/**
 * Create a new {@link CloudResources} instance for the specified {@link ApplicationArchive}.
 *
 * @param archive the application archive
 */
public CloudResources(ApplicationArchive archive) throws IOException {
    Assert.notNull(archive, "Archive must not be null");
    this.resources = new ArrayList<CloudResource>();
    for (ApplicationArchive.Entry entry : archive.getEntries()) {
        if (!entry.isDirectory()) {
            String name = entry.getName();
            long size = entry.getSize();
            String sha1 = bytesToHex(entry.getSha1Digest());
            CloudResource resource = new CloudResource(name, size, sha1);
            resources.add(resource);
        }
    }
}
 
开发者ID:SAP,项目名称:cf-java-client-sap,代码行数:19,代码来源:CloudResources.java

示例5: UploadApplicationPayload

import org.cloudfoundry.client.lib.archive.ApplicationArchive; //导入依赖的package包/类
/**
 * Create a new {@link UploadApplicationPayload}.
 *
 * @param archive              the source archive
 * @param knownRemoteResources resources that are already known on the remote server
 * @throws IOException
 */
public UploadApplicationPayload(ApplicationArchive archive, CloudResources knownRemoteResources) throws
        IOException {
    this.archive = archive;
    this.totalUncompressedSize = 0;
    Set<String> matches = knownRemoteResources.getFilenames();
    this.entriesToUpload = new ArrayList<DynamicZipInputStream.Entry>();
    for (ApplicationArchive.Entry entry : archive.getEntries()) {
        if (entry.isDirectory() || !matches.contains(entry.getName())) {
            entriesToUpload.add(new DynamicZipInputStreamEntryAdapter(entry));
            totalUncompressedSize += entry.getSize();
        }
    }
}
 
开发者ID:SAP,项目名称:cf-java-client-sap,代码行数:21,代码来源:UploadApplicationPayload.java

示例6: shouldGetFromArchive

import org.cloudfoundry.client.lib.archive.ApplicationArchive; //导入依赖的package包/类
@Test
public void shouldGetFromArchive() throws Exception {
    ZipFile zipFile = new ZipFile(SampleProjects.springTravel());
    try {
        ApplicationArchive archive = new ZipApplicationArchive(zipFile);
        CloudResources o = new CloudResources(archive);
        List<CloudResource> l = o.asList();
        assertThat(l.size(), is(96));
        assertThat(l.get(0).getFilename(), is("index.html"));
    } finally {
        zipFile.close();
    }
}
 
开发者ID:SAP,项目名称:cf-java-client-sap,代码行数:14,代码来源:CloudResourcesTest.java

示例7: getEntries

import org.cloudfoundry.client.lib.archive.ApplicationArchive; //导入依赖的package包/类
@Override
public Iterable<Entry> getEntries() {
	Iterable<ArchiveEntry> cfEntries = cfArchive.getEntries();
	List<ApplicationArchive.Entry> legacyEntries = new ArrayList<ApplicationArchive.Entry>();
	if (cfEntries != null) {
		for (ArchiveEntry entry : cfEntries) {
			legacyEntries.add(new V1ArchiveEntry(entry));
		}
	}
	return legacyEntries;
}
 
开发者ID:eclipse,项目名称:cft,代码行数:12,代码来源:ApplicationUtil.java

示例8: getEntries

import org.cloudfoundry.client.lib.archive.ApplicationArchive; //导入依赖的package包/类
public Iterable<Entry> getEntries() {
	if (entries == null) {
		entries = new ArrayList<ApplicationArchive.Entry>();
		collectEntriesPriorToDeployment(entries, resources.toArray(new IModuleResource[0]));
	}
	return entries;
}
 
开发者ID:osswangxining,项目名称:dockerfoundry,代码行数:8,代码来源:AbstractModuleResourceArchive.java

示例9: getApplicationArchive

import org.cloudfoundry.client.lib.archive.ApplicationArchive; //导入依赖的package包/类
public ApplicationArchive getApplicationArchive(DockerFoundryApplicationModule module,
		DockerFoundryServer cloudServer, IModuleResource[] moduleResources, IProgressMonitor monitor)
		throws CoreException {
	// No need for application archive, as the CF plugin framework generates
	// .war files for Java Web applications.
	return null;
}
 
开发者ID:osswangxining,项目名称:dockerfoundry,代码行数:8,代码来源:JavaWebApplicationDelegate.java

示例10: getIncrementalPublishArchive

import org.cloudfoundry.client.lib.archive.ApplicationArchive; //导入依赖的package包/类
protected ApplicationArchive getIncrementalPublishArchive(final ApplicationDeploymentInfo deploymentInfo,
		IModule[] modules) {
	IModuleResource[] allResources = getResources(modules);
	IModuleResourceDelta[] deltas = getPublishedResourceDelta(modules);
	List<IModuleResource> changedResources = getChangedResources(deltas);
	ApplicationArchive moduleArchive = new CachingApplicationArchive(Arrays.asList(allResources), changedResources,
			modules[0], deploymentInfo.getDeploymentName());

	return moduleArchive;
}
 
开发者ID:osswangxining,项目名称:dockerfoundry,代码行数:11,代码来源:DockerFoundryServerBehaviour.java

示例11: uploadApplication

import org.cloudfoundry.client.lib.archive.ApplicationArchive; //导入依赖的package包/类
@Override
public void uploadApplication(String appName, ApplicationArchive archive) throws IOException {
    cc.uploadApplication(appName, archive, null);
}
 
开发者ID:SAP,项目名称:cf-java-client-sap,代码行数:5,代码来源:CloudFoundryClient.java

示例12: DynamicZipInputStreamEntryAdapter

import org.cloudfoundry.client.lib.archive.ApplicationArchive; //导入依赖的package包/类
public DynamicZipInputStreamEntryAdapter(ApplicationArchive.Entry entry) {
    this.entry = entry;
}
 
开发者ID:SAP,项目名称:cf-java-client-sap,代码行数:4,代码来源:UploadApplicationPayload.java

示例13: uploadApplication

import org.cloudfoundry.client.lib.archive.ApplicationArchive; //导入依赖的package包/类
@Override
public void uploadApplication(String appName, ApplicationArchive archive) throws IOException {
}
 
开发者ID:SAP,项目名称:cf-mta-deploy-service,代码行数:4,代码来源:MockCloudFoundryClient.java

示例14: asV1ApplicationArchive

import org.cloudfoundry.client.lib.archive.ApplicationArchive; //导入依赖的package包/类
public static ApplicationArchive asV1ApplicationArchive(CFApplicationArchive cfArchive) {
	if (cfArchive != null) {
		return new V1ApplicationArchiveAdapter(cfArchive);
	}
	return null;
}
 
开发者ID:eclipse,项目名称:cft,代码行数:7,代码来源:ApplicationUtil.java

示例15: getApplicationArchive

import org.cloudfoundry.client.lib.archive.ApplicationArchive; //导入依赖的package包/类
public ApplicationArchive getApplicationArchive(DockerFoundryApplicationModule module,
		IModuleResource[] moduleResources) throws CoreException {
	return new ModuleResourceApplicationArchive(module.getLocalModule(), Arrays.asList(moduleResources));
}
 
开发者ID:osswangxining,项目名称:dockerfoundry,代码行数:5,代码来源:ModuleResourceApplicationDelegate.java


注:本文中的org.cloudfoundry.client.lib.archive.ApplicationArchive类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。