Package org.jboss.shrinkwrap.api.asset

Examples of org.jboss.shrinkwrap.api.asset.FileAsset


        for (String name : dir.list()) {
            File file = new File(dir, name);
            if (file.isDirectory()) {
                addFiles(archive, file, ArchivePaths.create(dest, name));
            } else {
                archive.add(new FileAsset(file), ArchivePaths.create(dest, name));
            }
        }
    }
View Full Code Here


        return ShrinkWrap.create(WebArchive.class)
                .addPackages(true, "com.steeplesoft.frenchpress")
//                .addPackages(true, "org.codehaus")
//                .addPackages(true, "com.google.gson")
                .addAsResource("persistence.xml", "META-INF/persistence.xml")
                .addAsWebInfResource(new FileAsset(new File("src/main/webapp/WEB-INF/web.xml")), "web.xml")
                .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
                .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
    }
View Full Code Here

    @Deployment
    public static WebArchive createTestArchive() {
        return ShrinkWrap.create(WebArchive.class)
                .addPackages(true, "com.steeplesoft.frenchpress")
                .addAsResource("persistence.xml", "META-INF/persistence.xml")
                .addAsResource(new FileAsset(new File("src/main/webapp/images/fp_logo_32.png")), "image.png")
                .addAsWebInfResource(new FileAsset(new File("src/main/webapp/WEB-INF/web.xml")), "web.xml")
                .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
                .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
    }
View Full Code Here

            final Result result = JarIndexer.createJarIndex(tempJarFile, indexer, false, false, false);

            final File indexFile = result.getOutputFile();
            indexFile.deleteOnExit();

            jandexIndexAsset = new FileAsset(indexFile);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }

        return jandexIndexAsset;
View Full Code Here

        {
            final Asset asset = node.getAsset();
            if (!(asset instanceof FileAsset)) {
                return null;
            }
            FileAsset fileAsset = (FileAsset) asset;
            final File file = AssetHelper.getFile(fileAsset);
            final String parentPath = file.getParentFile().getAbsolutePath();
            for (String rootPath : rootPaths) {
                if (parentPath.startsWith(rootPath)) {
                    final String subPath = file.getAbsolutePath().substring(rootPath.length());
View Full Code Here

 
    private static void addResources(String source, String target, WebArchive archive) {
    File sourceFile = new File(source);
    if (! sourceFile.exists()) return;
    if (sourceFile.isFile()) {
      archive.add(new FileAsset(sourceFile), target);
    }
   
    if (sourceFile.isDirectory()) {
            final File[] files = sourceFile.listFiles();
            if (files != null) {
View Full Code Here

   @Deployment
   public static Archive<?> createTestArchive()
   {
      JavaArchive fromJar = ShrinkWrap.create(JavaArchive.class, "ejb-jar.jar")
            .addClasses(InjectableBinder.class, InjectableIntf.class, Injectable.class)
            .add(new FileAsset(new File("src/test/resources/modules/ejb-jar.xml")), "META-INF/ejb-jar.xml")
            .add(EmptyAsset.INSTANCE, "META-INF/beans.xml");
      JavaArchive toJar = ShrinkWrap.create(JavaArchive.class, "to.jar")
            .addClasses(EjbjarLibIntoWarLibTest.class, JaxRsActivator.class, UtilityProducer.class)
            .addClasses(ModulesResourceIntf.class, ModulesResource.class)
            .add(EmptyAsset.INSTANCE, "META-INF/beans.xml");
View Full Code Here

                        TestStatus.class,
                        MyTaskWithListener.class,
                        MyTaskWithTransaction.class,
                        MyTransactionScopedBean.class,
                        TestBean.class).
                setWebXML(new FileAsset(new File("src/main/webapp/WEB-INF/web.xml"))).
                addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); // Adding beans.xml shouldn't be required? WildFly Beta1
    }
View Full Code Here

            new File("src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension"),
            "services/javax.enterprise.inject.spi.Extension");
  }

  public static FileAsset createFileAsset(final String pathname) {
    return new FileAsset(new File(pathname));
  }
View Full Code Here

        .addAsResource(createFileAsset("src/test/resources/log/log4j.properties"), "log4j.properties")
        .addAsWebInfResource(createFileAsset("src/test/resources/test/beans.xml"), "beans.xml");
  }

  public static FileAsset createFileAsset(final String pathname) {
    return new FileAsset(new File(pathname));
  }
View Full Code Here

TOP

Related Classes of org.jboss.shrinkwrap.api.asset.FileAsset

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.