Examples of ZipExporter


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

   }

   private Bundle installBundle(BundleContext context, Archive<?> archive) throws BundleException
   {
      // Export the bundle bytes
      ZipExporter exporter = archive.as(ZipExporter.class);
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      exporter.exportZip(baos);

      InputStream inputStream = new ByteArrayInputStream(baos.toByteArray());
      return context.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

        final String tempDir = System.getProperty("java.io.tmpdir");
        archiveOnDisk = new File(tempDir + File.separator + archive.getName());
        if(archiveOnDisk.exists()) {
            archiveOnDisk.delete();
        }
        final ZipExporter exporter = archive.as(ZipExporter.class);
        exporter.exportTo(archiveOnDisk);
        final String archiveArg;
        if(clientArchiveName == null) {
            archiveArg = archiveOnDisk.getAbsolutePath();
        } else {
            archiveArg = archiveOnDisk.getAbsolutePath() + "#" + clientArchiveName;
View Full Code Here

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

      }
   }

   private void validateBundleArchive(Archive<?> archive) throws Exception
   {
      ZipExporter exporter = archive.as(ZipExporter.class);
      InputStream inputStream = exporter.exportAsInputStream();
      VirtualFile virtualFile = AbstractVFS.toVirtualFile(inputStream);
      BundleInfo.createBundleInfo(virtualFile);
   }
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

         try
         {
            Thread.currentThread().setContextClassLoader(JavaArchive.class.getClassLoader());
            Archive<?> archive = (Archive<?>)apMethod.invoke(null, requestedCommand.getArguments()[0]);

            ZipExporter ze = archive.as(ZipExporter.class);
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            ze.exportZip(baos);
            testRunner.commandResult(requestedCommand.getId(), baos.toByteArray());
         }
         catch (Exception e)
         {
            throw new RuntimeException(e);
View Full Code Here

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

    }

    @SuppressWarnings("unused")
    static private void exportZip(Archive<?> zipArchive, File outFile) {
        try {
            ZipExporter exporter = new ZipExporterImpl(zipArchive);
            exporter.exportTo(outFile, true);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
View Full Code Here

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

        final String tempDir = System.getProperty("java.io.tmpdir");
        archiveOnDisk = new File(tempDir + File.separator + archive.getName());
        if(archiveOnDisk.exists()) {
            archiveOnDisk.delete();
        }
        final ZipExporter exporter = archive.as(ZipExporter.class);
        exporter.exportTo(archiveOnDisk);
        final String archiveArg;
        if(clientArchiveName == null) {
            archiveArg = archiveOnDisk.getAbsolutePath();
        } else {
            archiveArg = archiveOnDisk.getAbsolutePath() + "#" + clientArchiveName;
View Full Code Here

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

            }
        }
    }

    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

    @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
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.