Examples of ZipExporter


Examples of org.jboss.shrinkwrap.api.exporter.ZipExporter

   public ContainerMethodExecutor deploy(Context context, final Archive<?> archive) throws DeploymentException
   {
      try
      {
         // Export the bundle bytes
         ZipExporter exporter = archive.as(ZipExporter.class);
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         exporter.exportZip(baos);
        
         ByteArrayInputStream inputStream = new ByteArrayInputStream(baos.toByteArray());
        
         BundleContext sysContext = framework.getBundleContext();
         Bundle bundle = sysContext.installBundle(archive.getName(), inputStream);
View Full Code Here

Examples of org.jboss.shrinkwrap.api.exporter.ZipExporter

    @Override
    public ProtocolMetaData deploy(final Archive<?> archive) throws DeploymentException {
        try {
            // Export the bundle bytes
            ZipExporter exporter = archive.as(ZipExporter.class);
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            exporter.exportTo(baos);

            String location = archive.getName();
            ByteArrayInputStream inputStream = new ByteArrayInputStream(baos.toByteArray());
            log.info("Installing bundle: " + location);
            installBundle(location, inputStream);
View Full Code Here

Examples of org.jboss.shrinkwrap.api.exporter.ZipExporter

        Assert.assertEquals(2, count);
    }

    private JarFile toJarFile(JavaArchive archive) throws IOException {
        ZipExporter exporter = archive.as(ZipExporter.class);
        File targetFile = new File("target/shrinkwrap/" + archive.getName());
        targetFile.getParentFile().mkdirs();
        exporter.exportTo(targetFile, true);
        return new JarFile(targetFile);
    }
View Full Code Here

Examples of org.jboss.shrinkwrap.api.exporter.ZipExporter

        File targetFile = new File(targetDir, fullName);
        if (targetFile.exists()) {
            Assert.assertTrue(targetFile.delete());
        }

        ZipExporter exporter = module.as(ZipExporter.class);
        exporter.exportTo(targetFile, true);

        return targetDir;
    }
View Full Code Here

Examples of org.jboss.shrinkwrap.api.exporter.ZipExporter

    @Override
    public ProtocolMetaData deploy(final Archive<?> archive) throws DeploymentException {
        try {
            // Export the bundle bytes
            ZipExporter exporter = archive.as(ZipExporter.class);
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            exporter.exportTo(baos);

            ByteArrayInputStream inputStream = new ByteArrayInputStream(baos.toByteArray());
            syscontext.installBundle(archive.getName(), inputStream);

        } catch (RuntimeException rte) {
View Full Code Here

Examples of org.jboss.shrinkwrap.api.exporter.ZipExporter

            VFSUtils.safeClose(virtualFile);
        }
    }

    private VirtualFile toVirtualFile(Archive<?> archive) throws IOException {
        ZipExporter exporter = archive.as(ZipExporter.class);
        return AbstractVFS.toVirtualFile(archive.getName(), exporter.exportAsInputStream());
    }
View Full Code Here

Examples of org.jboss.shrinkwrap.api.exporter.ZipExporter

    warFile.deleteOnExit();
    JavaArchive jar = ShrinkWrap.create(JavaArchive.class, "foo.jar");
    jar.addClass(FSTestCase.class);
    WebArchive war = ShrinkWrap.create(WebArchive.class);
    war.addAsLibraries(jar);
    ZipExporter exporter = war.as(ZipExporter.class);
    exporter.exportTo(warFile, true);
    this.warFile = warFile;
  }
View Full Code Here

Examples of org.jboss.shrinkwrap.api.exporter.ZipExporter

    // Generate test jar
    java.io.File file = java.io.File.createTempFile("test", ".jar");
    file.deleteOnExit();
    JavaArchive archive = ShrinkWrap.create(JavaArchive.class);
    archive.addClass(FSTestCase.class);
    ZipExporter exporter = archive.as(ZipExporter.class);
    exporter.exportTo(file, true);

    //
    URLDriver driver = new URLDriver();
    driver.merge(file.toURI().toURL());
    Node root = driver.root();
View Full Code Here

Examples of org.jboss.shrinkwrap.api.exporter.ZipExporter

  }

  public static File toFile(Archive archive, String ext) {
    File tmp = assertTmpFile(ext);
    if (tmp.delete()) {
      ZipExporter exporter = archive.as(ZipExporter.class);
      exporter.exportTo(tmp);
      tmp.deleteOnExit();
      return tmp;
    } else {
      throw failure("Could not delete tmp file " + tmp.getAbsolutePath());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.