Package org.jboss.shrinkwrap.impl.base.path

Examples of org.jboss.shrinkwrap.impl.base.path.BasicPath


        //build cli archive
        EnterpriseArchive cliArchive = ShrinkWrap.create(EnterpriseArchive.class, "archive.cli");
        String deploy = "deploy deployment0.war\ndeploy deployment1.war";
        String undeploy = "undeploy deployment0.war\nundeploy deployment1.war";
        cliArchive.add(new StringAsset(deploy), new BasicPath("/", "deploy.scr"));
        cliArchive.add(new StringAsset(undeploy), new BasicPath("/", "undeploy.scr"));
        for (WebArchive war : wars) {
            cliArchive.add(war, new BasicPath("/"), ZipExporter.class);
        }
        cliArchiveFile = new File(tempDir + File.separator + "archive.cli");
        new ZipExporterImpl(cliArchive).exportTo(cliArchiveFile, true);

        AbstractCliTestBase.initCLI();
View Full Code Here


        WebArchive war = ShrinkWrap.create(WebArchive.class, "single.war");
        war.addAsWebResource(new StringAsset("a"), "a.txt");
        war.addAsWebResource(new StringAsset("b"), "b.txt");

        JavaArchive jar = ShrinkWrap.create(JavaArchive.class, "test.jar");
        jar.addAsManifestResource(new StringAsset("b - overlay"), new BasicPath("resources", "b.txt"));
        jar.addAsManifestResource(new StringAsset("c - overlay"), new BasicPath("resources", "c.txt"));

        war.addAsLibrary(jar);
        return war;
    }
View Full Code Here

        //build cli archive
        EnterpriseArchive cliArchive = ShrinkWrap.create(EnterpriseArchive.class, "archive.cli");
        String deploy = "deploy deployment0.war\ndeploy deployment1.war";
        String undeploy = "undeploy deployment0.war\nundeploy deployment1.war";
        cliArchive.add(new StringAsset(deploy), new BasicPath("/", "install.scr"));
        // add the default script which shouldn't be picked up
        cliArchive.add(new StringAsset("deploy deployment0.war\ndeploy deployment1.war\ndeploy deployment2.war"), new BasicPath("/", "deploy.scr"));
        cliArchive.add(new StringAsset(undeploy), new BasicPath("/", "uninstall.scr"));
        cliArchive.add(new StringAsset("undeploy deployment0.war\nundeploy deployment1.war\nundeploy deployment2.war"), new BasicPath("/", "undeploy.scr"));
        for (WebArchive war : wars) {
            cliArchive.add(war, new BasicPath("/"), ZipExporter.class);
        }
        cliArchiveFile = new File(tempDir + File.separator + "archive.cli");
        new ZipExporterImpl(cliArchive).exportTo(cliArchiveFile, true);
    }
View Full Code Here

        // deployment4
        war = ShrinkWrap.create(WebArchive.class, "cli-test-app3.war");
        war.addClass(SimpleServlet.class);
        war.addAsWebResource(new StringAsset("Version3"), "page.html");
        final EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, "cli-test-app.ear");
        ear.add(war, new BasicPath("/"), ZipExporter.class);
        appFiles[3] = new File(tempDir + File.separator + ear.getName());
        new ZipExporterImpl(ear).exportTo(appFiles[3], true);
    }
View Full Code Here

        //build cli archive
        EnterpriseArchive cliArchive = ShrinkWrap.create(EnterpriseArchive.class, "archive.cli");
        String deploy = "deploy deployment0.war\ndeploy deployment1.war";
        String undeploy = "undeploy deployment0.war\nundeploy deployment1.war";
        cliArchive.add(new StringAsset(deploy), new BasicPath("/", "deploy.scr"));
        cliArchive.add(new StringAsset(undeploy), new BasicPath("/", "undeploy.scr"));
        for (WebArchive war : wars) {
            cliArchive.add(war, new BasicPath("/"), ZipExporter.class);
        }
        cliArchiveFile = new File(tempDir + File.separator + "archive.cli");
        new ZipExporterImpl(cliArchive).exportTo(cliArchiveFile, true);
    }
View Full Code Here

     * @return
     */
    public static ArchivePath getFullPathForClassResource(Class<?> clazz) {
        String classResourceDelimiter = clazz.getName().replaceAll(DELIMITER_CLASS_NAME_PATH, DELIMITER_RESOURCE_PATH);
        String classFullPath = classResourceDelimiter + EXTENSION_CLASS;
        return new BasicPath(classFullPath);
    }
View Full Code Here

     * @return
     */
    public static ArchivePath getFullPathForClassResource(String className) {
        String classResourceDelimiter = className.replaceAll(DELIMITER_CLASS_NAME_PATH, DELIMITER_RESOURCE_PATH);
        String classFullPath = classResourceDelimiter + EXTENSION_CLASS;
        return new BasicPath(classFullPath);
    }
View Full Code 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

     */
    private ArchivePath resolveClassesPath(Archive<?> archive) {
        if (archive instanceof WebArchive) {
            return ArchivePaths.create("WEB-INF/classes");
        } else if (archive instanceof JavaArchive) {
            return new BasicPath("/");
        }
        return null;
    }
View Full Code Here

TOP

Related Classes of org.jboss.shrinkwrap.impl.base.path.BasicPath

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.