OK, I see what you are after now :-)  The fileinstall config handler doesn't
currently support multivalue properties, so whatever you set on a property
value gets parsed as a single string (the code simply uses load(inputstream)
from the Properties class).  This functionality could probably be added, but
we would have to decide on a way to differentiate between scalar values and
arrays ("this, is, one, string" vs. String[] property =
{"this","is","one","string"} ).  Another option would be to support syntax
similar to the scr javadoc annotations and munge the properties into an
array (value.1="this", value.2="is", etc become String[] property =
{"this","is", etc} ).  If you are interested in that feature, please create
a Jira and someone will take a look.
http://issues.apache.org/jira/browse/FELIX

Until then, you could either add your own config admin code to do something
like this, or you can add a method with a single string argument to accept
the property and then parse and process into your component after it is set
by scr from the config admin.

Thanks,
Chris

--
Chris Custine
FUSESource :: http://fusesource.com
My Blog :: http://blog.organicelement.com
Apache ServiceMix :: http://servicemix.apache.org
Apache Felix :: http://felix.apache.org
Apache Directory Server :: http://directory.apache.org


On Thu, Mar 18, 2010 at 10:11 AM, Justin Edelson <[email protected]>wrote:

> Thanks Chris.
>
> I was actually referring to the configuration files (with .cfg
> extension) which is described here:
>
> http://felix.apache.org/site/apache-felix-file-install.html#ApacheFelixFileInstall-Configurations
>
> I would like to set a property to a String array. With scr qdox
> annotations, this would look like this:
>    /**
>     * @scr.property values.1="/foo" values.2="/bar"
>     */
>
> I saw this line in the documentation:
> header ::= <header> ( ':' | '=' ) <value> ( '\<nl> <value> ) *
>
> which implied to me that the syntax I used below would work.
>
> If no one knows, I'll look through the code. Maybe this isn't possible.
>
> Justin
>
>
> On 3/17/10 11:37 PM, Chris Custine wrote:
> > There really aren't any config properties for fileinstall that accept
> > multiple values as far as I know.  If you need to monitor multiple
> > directories you can create multiple config files as shown in the
> > fileinstall docs
> > here:
> http://felix.apache.org/site/apache-felix-file-install.html#ApacheFelixFileInstall-WatchingmultipledirectorieswithFileInstall
> >
> > Chris
> > <
> http://felix.apache.org/site/apache-felix-file-install.html#ApacheFelixFileInstall-WatchingmultipledirectorieswithFileInstall
> >
> > --
> > Chris Custine
> > FUSESource :: http://fusesource.com
> > My Blog :: http://blog.organicelement.com
> > Apache ServiceMix :: http://servicemix.apache.org
> > Apache Felix :: http://felix.apache.org
> > Apache Directory Server :: http://directory.apache.org
> >
> >
> > On Wed, Mar 17, 2010 at 7:07 PM, Justin Edelson <[email protected]
> > <mailto:[email protected]>> wrote:
> >
> >     What is the correct syntax for multi-valued properties in a
> fileinstall
> >     cfg file? I tried a few variations on:
> >
> >     name=value1 \
> >      value2 \
> >      value3
> >
> >     but they didn't work.
> >
> >     Thanks,
> >     Justin
> >
> >     ---------------------------------------------------------------------
> >     To unsubscribe, e-mail: [email protected]
> >     <mailto:[email protected]>
> >     For additional commands, e-mail: [email protected]
> >     <mailto:[email protected]>
> >
> >
>
>

Reply via email to