* @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();
}