Package org.jboss.forge.resources

Examples of org.jboss.forge.resources.PropertiesFileResource$SortedProperties


         propertyValue = propertiesFileResource.getProperty(key);
      }
      else
      {
         String bundleName = getBaseBundleName(propertiesFileResource.getName()) + "_" + locale + ".properties";
         PropertiesFileResource newFilePropertiesResource = getOrCreate(bundleName);
         propertyValue = newFilePropertiesResource.getProperty(key);
      }
      shell.println(propertyValue);
   }
View Full Code Here


      {
         baseName = getBaseBundleName(propertiesFileResource.getName());
      }

      final String baseBundleName = (baseName + "_" + locale + ".properties");
      PropertiesFileResource newFileResource = getOrCreate(baseBundleName);
      shell.setCurrentResource(newFileResource);
   }
View Full Code Here

    */
   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();
         }
      }
      return newFileResource;
   }
View Full Code Here

TOP

Related Classes of org.jboss.forge.resources.PropertiesFileResource$SortedProperties

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.