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


        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

   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

        log.debugf("Add dependencies: %s", moduleDeps);
        attributes.putValue("Dependencies", moduleDeps.toString());

        // Add the manifest to the archive
        ArchivePath manifestPath = ArchivePaths.create(JarFile.MANIFEST_NAME);
        appArchive.delete(manifestPath);
        appArchive.add(new Asset() {
                    public InputStream openStream() {
                        try {
                            ByteArrayOutputStream baos = new ByteArrayOutputStream();
View Full Code Here

        }
        return super.findResources(name);
    }

    private Node findNode(final String name) {
        ArchivePath path = ArchivePaths.create(prefix + name);
        Node node = archive.get(path);
        if (node == null) {
            path = ArchivePaths.create(name);
            node = archive.get(path);
View Full Code Here

                    // 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), ArchivePaths.create(classesPath, classNamePath));
                    } else {
                        archive.addClass(className);
                    }
                }
            };
View Full Code Here

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

            if(simpleNames.isEmpty()) {
                return;
View Full Code Here

            }
         });

         for (Entry<ArchivePath, Node> entry : content.entrySet())
         {
            ArchivePath path = entry.getKey();
            File target = new File(baseDir.getAbsolutePath() + "/" + path.get().replaceFirst("/lib/", ""));
            target.mkdirs();
            target.delete();
            target.createNewFile();

            Node node = entry.getValue();
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

   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

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.