本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}