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


Java ZipExporter.exportTo方法代码示例

本文整理汇总了Java中org.jboss.shrinkwrap.api.exporter.ZipExporter.exportTo方法的典型用法代码示例。如果您正苦于以下问题:Java ZipExporter.exportTo方法的具体用法?Java ZipExporter.exportTo怎么用?Java ZipExporter.exportTo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jboss.shrinkwrap.api.exporter.ZipExporter的用法示例。


在下文中一共展示了ZipExporter.exportTo方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createJar

import org.jboss.shrinkwrap.api.exporter.ZipExporter; //导入方法依赖的package包/类
private File createJar(String baseName, Path dir) throws IOException {
    File out = getOutputFile(baseName, dir);
    if (!out.getParentFile().exists() && !out.getParentFile().mkdirs()) {
        this.log.error("Failed to create parent directory for: " + out.getAbsolutePath());
    }
    ZipExporter exporter = this.archive.as(ZipExporter.class);
    try (FileOutputStream fos = new FileOutputStream(out)) {
        if (executable) {
            try (InputStream is = getLaunchScript()) {
                IOUtil.copy(is, fos);
            }
        }
        exporter.exportTo(fos);
    }
    if (executable) {
        if (!out.setExecutable(true)) {
            this.log.error("Failed to set executable flag");
        }
    }
    return out;
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:22,代码来源:BuildTool.java

示例2: createDeployment

import org.jboss.shrinkwrap.api.exporter.ZipExporter; //导入方法依赖的package包/类
@Deployment
public static WebArchive createDeployment() {
    File[] libs = Maven.configureResolver().fromFile(shrinkwrapMavenSettings).loadPomFromFile("pom.xml")
            .resolve("org.hawkular.commons:hawkular-rest-status", "com.squareup.okhttp3:okhttp")
            .withTransitivity().asFile();
    WebArchive archive = ShrinkWrap.create(WebArchive.class, StatusEndpointITest.class.getSimpleName() + ".war")
            .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
            .addAsWebInfResource(
                    StatusEndpointITest.class.getResource("/rest-status/jboss-deployment-structure.xml"),
                    "jboss-deployment-structure.xml")
            .addAsWebInfResource(
                    StatusEndpointITest.class.getResource("/rest-status/jboss-web.xml"),
                    "jboss-web.xml")
            .addAsWebInfResource(
                    StatusEndpointITest.class.getResource("/rest-status/web.xml"),
                    "web.xml")
            .addAsManifestResource(
                    StatusEndpointITest.class.getResource("/rest-status/MANIFEST.MF"),
                    "MANIFEST.MF")
            .addPackage(StatusEndpointITest.class.getPackage())
            .addAsLibraries(libs);
    ZipExporter exporter = new ZipExporterImpl(archive);
    exporter.exportTo(new File("target", StatusEndpointITest.class.getSimpleName() + ".war"));
    return archive;
}
 
开发者ID:hawkular,项目名称:hawkular-commons,代码行数:26,代码来源:StatusEndpointITest.java

示例3: createDeployment

import org.jboss.shrinkwrap.api.exporter.ZipExporter; //导入方法依赖的package包/类
@Deployment
public static WebArchive createDeployment() {
    WebArchive archive = ShrinkWrap.create(WebArchive.class)
            .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
            .addAsWebInfResource(BusTest.class.getResource("/jboss-deployment-structure.xml"),
                    "jboss-deployment-structure.xml")
            .addPackage(BusTest.class.getPackage());
    ZipExporter exporter = new ZipExporterImpl(archive);
    exporter.exportTo(new File("target", "test-archive.war"));

    return archive;
}
 
开发者ID:hawkular,项目名称:hawkular-bus,代码行数:13,代码来源:BusTest.java

示例4: createDeployment

import org.jboss.shrinkwrap.api.exporter.ZipExporter; //导入方法依赖的package包/类
@Deployment
public static WebArchive createDeployment() {
    WebArchive archive = ShrinkWrap.create(WebArchive.class)
            .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
            .addAsWebInfResource(BusITest.class.getResource("/bus/jboss-deployment-structure.xml"),
                    "jboss-deployment-structure.xml")
            .addPackage(BusITest.class.getPackage());
    ZipExporter exporter = new ZipExporterImpl(archive);
    exporter.exportTo(new File("target", "test-archive.war"));

    return archive;
}
 
开发者ID:hawkular,项目名称:hawkular-commons,代码行数:13,代码来源:BusITest.java

示例5: createJar

import org.jboss.shrinkwrap.api.exporter.ZipExporter; //导入方法依赖的package包/类
private File createJar(String baseName, Path dir) throws IOException {
    File out = new File(dir.toFile(), baseName + "-swarm.jar");
    out.getParentFile().mkdirs();
    ZipExporter exporter = this.archive.as(ZipExporter.class);
    exporter.exportTo(out, true);
    return out;
}
 
开发者ID:wildfly-swarm-archive,项目名称:ARCHIVE-wildfly-swarm,代码行数:8,代码来源:BuildTool.java

示例6: _installPortalDependencies

import org.jboss.shrinkwrap.api.exporter.ZipExporter; //导入方法依赖的package包/类
private void _installPortalDependencies() throws LifecycleException {
	JavaArchive archive = ShrinkWrap.create(
		JavaArchive.class, "arquillian-install-portlet-in-liferay.jar");

	archive.addClass(PortalURLBundleActivator.class);
	archive.addClass(PortalURLServlet.class);

	archive.setManifest(
		new Asset() {

			@Override
			public InputStream openStream() {
				OSGiManifestBuilder builder =
					OSGiManifestBuilder.newInstance();

				builder.addBundleManifestVersion(2);
				builder.addBundleSymbolicName(
					"arquillian-install-portlet-in-liferay");
				builder.addImportPackages(
					"com.liferay.portal.kernel.exception",
					"com.liferay.portal.kernel.util",
					"com.liferay.portal.kernel.model",
					"com.liferay.portal.kernel.service",
					"javax.servlet.http", "javax.portlet", "javax.servlet",
					"org.osgi.framework");
				builder.addBundleActivator(PortalURLBundleActivator.class);

				return builder.openStream();
			}

		});

	UUID uuid = UUID.randomUUID();

	File tmpfile = new File("tmpfiles" + uuid.toString() + ".jar");

	ZipExporter exporter = archive.as(ZipExporter.class);

	exporter.exportTo(tmpfile);

	_installBundle(tmpfile.getAbsolutePath());

	tmpfile.deleteOnExit();
}
 
开发者ID:liferay-labs,项目名称:arquillian-liferay,代码行数:45,代码来源:LiferayInstallDependenciesObserver.java


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