Package org.jboss.forge.project.facets

Examples of org.jboss.forge.project.facets.ResourceFacet


         String baseName = "messages";
         if (propertiesFileResource != null)
         {
            baseName = getBaseBundleName(propertiesFileResource.getName());
         }
         final ResourceFacet resourceFacet = project.getFacet(ResourceFacet.class);
         final BundleBaseNameResourceFilter filter = new BundleBaseNameResourceFilter(baseName);
         for (DirectoryResource resourceFolder : resourceFacet.getResourceFolders())
         {
            for (Resource<?> r : resourceFolder.listResources(filter))
            {
               shell.println("Removing key \"" + key + "\" on bundle " + r.getFullyQualifiedName());
               ((PropertiesFileResource) r).removeProperty(key);
View Full Code Here


    * @param bundleName
    * @return
    */
   protected PropertiesFileResource getOrCreate(final String bundleName)
   {
      final ResourceFacet resourceFacet = project.getFacet(ResourceFacet.class);
      final BundleBaseNameResourceFilter filter = new BundleBaseNameResourceFilter(bundleName);
      PropertiesFileResource newFileResource = null;
      for (DirectoryResource directoryResource : resourceFacet.getResourceFolders())
      {
         for (Resource<?> resource : directoryResource.listResources(filter))
         {
            newFileResource = (PropertiesFileResource) resource;
            // Using the first resource found
            break;
         }
      }
      if (newFileResource == null)
      {
         newFileResource = resourceFacet.getResourceFolder().getChildOfType(PropertiesFileResource.class,
                  bundleName);
         if (!newFileResource.exists())
         {
            newFileResource.createNewFile();
         }
View Full Code Here

   }

   @Override
   public FileResource<?> getConfigFile()
   {
      ResourceFacet resources = project.getFacet(ResourceFacet.class);
      return (FileResource<?>) resources.getResourceFolder().getChild("META-INF" + File.separator + "persistence.xml");
   }
View Full Code Here

public class WebTestImpl implements WebTest
{
   @Override
   public void setup(final Project project)
   {
      ResourceFacet resources = project.getFacet(ResourceFacet.class);
      FileResource<?> arquillian = resources.getTestResource("arquillian.xml");
      if (!arquillian.exists())
      {
         arquillian.createNewFile();
         arquillian.setContents(this.getClass().getResourceAsStream("/web/arquillian.xml"));
      }
View Full Code Here

   }

   @Override
   public FileResource<?> getConfigFile()
   {
      final ResourceFacet facet = project.getFacet(ResourceFacet.class);
      return facet.getResource("META-INF" + File.separator + "validation.xml");
   }
View Full Code Here

   }

   @Override
   public FileResource<?> getConfigFile()
   {
      ResourceFacet resources = project.getFacet(ResourceFacet.class);
      return (FileResource<?>) resources.getResourceFolder().getChild("META-INF" + File.separator + "persistence.xml");
   }
View Full Code Here

         String baseName = "messages";
         if (propertiesFileResource != null)
         {
            baseName = getBaseBundleName(propertiesFileResource.getName());
         }
         final ResourceFacet resourceFacet = project.getFacet(ResourceFacet.class);
         final BundleBaseNameResourceFilter filter = new BundleBaseNameResourceFilter(baseName);
         for (DirectoryResource resourceFolder : resourceFacet.getResourceFolders())
         {
            for (Resource<?> r : resourceFolder.listResources(filter))
            {
               shell.println("Removing key \"" + key + "\" on bundle " + r.getFullyQualifiedName());
               ((PropertiesFileResource) r).removeProperty(key);
View Full Code Here

    * @param bundleName
    * @return
    */
   protected PropertiesFileResource getOrCreate(final String bundleName)
   {
      final ResourceFacet resourceFacet = project.getFacet(ResourceFacet.class);
      final BundleBaseNameResourceFilter filter = new BundleBaseNameResourceFilter(bundleName);
      PropertiesFileResource newFileResource = null;
      for (DirectoryResource directoryResource : resourceFacet.getResourceFolders())
      {
         for (Resource<?> resource : directoryResource.listResources(filter))
         {
            newFileResource = (PropertiesFileResource) resource;
            // Using the first resource found
            break;
         }
      }
      if (newFileResource == null)
      {
         newFileResource = resourceFacet.getResourceFolder().getChildOfType(PropertiesFileResource.class,
                  bundleName);
         if (!newFileResource.exists())
         {
            newFileResource.createNewFile();
         }
View Full Code Here

      }
   }

   private void configureSelectedContainer(String containerId)
   {
      ResourceFacet resources = project.getFacet(ResourceFacet.class);
      FileResource<?> resource = (FileResource<?>) resources.getTestResourceFolder().getChild("arquillian.xml");
      Node arquillianConfig = null;
      if (!resource.exists())
      {
         arquillianConfig = createNewArquillianConfig();
      }
View Full Code Here

         if (configuration == null)
         {
            break;
         }

         ResourceFacet resources = project.getFacet(ResourceFacet.class);
         FileResource<?> resource = (FileResource<?>) resources.getTestResourceFolder().getChild("arquillian.xml");

         Node xml = null;
         if (!resource.exists())
         {
            xml = createNewArquillianConfig();
View Full Code Here

TOP

Related Classes of org.jboss.forge.project.facets.ResourceFacet

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.