Package org.jboss.shrinkwrap.api

Examples of org.jboss.shrinkwrap.api.ArchivePath


                if (classesPackage == null) {
                    classesPackage = clazz.getPackage();
                }
                Asset resource = new ClassAsset(clazz);
                ArchivePath location = ArchivePaths.create(resolveClassesPath(archive),
                        AssetUtil.getFullPathForClassResource(clazz));
                archive.add(resource, location);
            }

            // Quite naive way of handling inner classes
View Full Code Here


                    }

                    // This is a performance WORKAROUND - adding classes via ClassContainer.addClass() is much slower
                    // Actually the performace loss is caused by inner classes handling - which is not necessary here
                    // See also org.jboss.shrinkwrap.impl.base.container.ContainerBase addPackage() and getClassesPath() methods
                    ArchivePath classesPath = resolveClassesPath(archive);

                    if (classesPath != null) {
                        ArchivePath classNamePath = AssetUtil.getFullPathForClassResource(className);
                        archive.add(new ClassLoaderAsset(classNamePath.get().substring(1), clToUse), new BasicPath(classesPath,
                                classNamePath));
                    } else {
                        archive.addClass(className);
                    }
                }
View Full Code Here

                if (classesPackage == null) {
                    classesPackage = clazz.getPackage();
                }
                Asset resource = new ClassAsset(clazz);
                ArchivePath location = new BasicPath(resolveClassesPath(archive), AssetUtil.getFullPathForClassResource(clazz));
                archive.add(resource, location);
            }

            // Quite naive way of handling inner classes
            // The reason for this is that similar code would be normally called for each class - see also
View Full Code Here

  public void exportTo(File dir) throws IOException {
    FileUtils.deleteDirectory(dir);
    dir.mkdirs();
    Map<ArchivePath, Node> content = super.getArchive().getContent();
    for (Entry<ArchivePath, Node> entry : content.entrySet()) {
      ArchivePath path = entry.getKey();
      Node node = entry.getValue();
          String pathName = PathUtil.optionallyRemovePrecedingSlash(path.get());
          File target = new File(dir, pathName);
          boolean isDirectory = node.getAsset() == null;
          InputStream stream = null;
          if (!isDirectory) {
              stream = node.getAsset().openStream();
View Full Code Here

         // reuse handle(JavaArchive, ..) logic
         Archive<?> wrappedWar = handleArchive(protocol, new ArrayList<Archive<?>>(), null, processor);
         applicationArchive
               .addAsModule(wrappedWar);
        
         ArchivePath applicationXmlPath = ArchivePaths.create("META-INF/application.xml");
         if(applicationArchive.contains(applicationXmlPath))
         {
            ApplicationDescriptor applicationXml = Descriptors.importAs(ApplicationDescriptor.class).from(
                  applicationArchive.get(applicationXmlPath).getAsset().openStream());
           
View Full Code Here

            " can not handle archive of type " +  applicationArchive.getClass().getName());
   }

   private Archive<?> handleArchive(WebArchive applicationArchive, Collection<Archive<?>> auxiliaryArchives, WebArchive protocol, Processor processor)
   {
      ArchivePath webXmlPath = ArchivePaths.create("WEB-INF/web.xml");
      if(applicationArchive.contains(webXmlPath))
      {
         WebAppDescriptor applicationWebXml = Descriptors.importAs(WebAppDescriptor.class).from(
               applicationArchive.get(webXmlPath).getAsset().openStream());
        
View Full Code Here

         applicationArchive
               .addAsModule(
                     protocol.setWebXML(
                           new StringAsset(createNewDescriptor().exportAsString())));
        
         ArchivePath applicationXmlPath = ArchivePaths.create("META-INF/application.xml");
         if(applicationArchive.contains(applicationXmlPath))
         {
            ApplicationDescriptor applicationXml = Descriptors.importAs(ApplicationDescriptor.class).from(
                  applicationArchive.get(applicationXmlPath).getAsset().openStream());
           
View Full Code Here

   private Archive<?> handleArchive(EnterpriseArchive applicationArchive, Collection<Archive<?>> auxiliaryArchives, WebArchive protocol, Processor processor)
   {
      Map<ArchivePath, Node> applicationArchiveWars = applicationArchive.getContent(Filters.include(".*\\.war"));
      if(applicationArchiveWars.size() == 1)
      {
         ArchivePath warPath = applicationArchiveWars.keySet().iterator().next();
         try
         {
            handleArchive(
                  applicationArchive.getAsType(WebArchive.class, warPath),
                  new ArrayList<Archive<?>>(), // reuse the War handling, but Auxiliary Archives should be added to the EAR, not the WAR
View Full Code Here

   private Archive<?> handleArchive(EnterpriseArchive applicationArchive, Collection<Archive<?>> auxiliaryArchives, JavaArchive protocol, Processor processor)
   {
      Map<ArchivePath, Node> applicationArchiveWars = applicationArchive.getContent(Filters.include(".*\\.war"));
      if(applicationArchiveWars.size() == 1)
      {
         ArchivePath warPath = applicationArchiveWars.keySet().iterator().next();
         try
         {
            handleArchive(
                  applicationArchive.getAsType(WebArchive.class, warPath),
                  new ArrayList<Archive<?>>(), // reuse the War handling, but Auxiliary Archives should be added to the EAR, not the WAR
View Full Code Here

        final File realArchive;

        public Deployment(String archiveName, Package pkg, boolean show) {
            this.archiveName = archiveName;

            ArchivePath metaInf = ArchivePaths.create("META-INF");

            archive = ShrinkWrap.create(JavaArchive.class, archiveName);
            archive.addPackage(pkg);

            File sourceMetaInf = getSourceMetaInfDir();
View Full Code Here

TOP

Related Classes of org.jboss.shrinkwrap.api.ArchivePath

Copyright © 2018 www.massapicom. 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.