[Yanel-dev] Patch re getResourceConfigProperty

Josias Thöny josias.thoeny at wyona.com
Tue May 15 08:57:39 CEST 2007


On Mon, 2007-05-14 at 23:07 +0200, Michael Wechner wrote:
> Hi
> 
> Just to better understand I wanted to ask if the following patch is to 
> simplify accessing ResourceConfiguration properties (please see below), 
> right?

Yes, this code was used in several resources, and I moved it to
Resource.java to prevent code duplication and because those methods are
useful for any resource type.

Josias

> 
> Thanks
> 
> Michi
> 
> --- src/core/java/org/wyona/yanel/core/Resource.java    (revision 24452)
> +++ src/core/java/org/wyona/yanel/core/Resource.java    (working copy)
> @@ -260,4 +260,23 @@
>          return language;
>      }
> 
> +    /**
> +     * Get property value from resource configuration
> +     */
> +    public String getResourceConfigProperty(String name) throws Exception {
> +        ResourceConfiguration rc = getConfiguration();
> +        if (rc != null) return rc.getProperty(name);
> +        return getRTI().getProperty(name);
> +    }
> +
> +    /**
> +     * Get property value from resource configuration
> +     */
> +    public String[] getResourceConfigProperties(String name) throws 
> Exception {
> +        ResourceConfiguration rc = getConfiguration();
> +        if (rc != null) return rc.getProperties(name);
> +        return getRTI().getProperties(name);
> +    }
> +
> +
>  }
> 




More information about the Yanel-development mailing list