You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by ribeiant <ri...@students.zhaw.ch> on 2008/07/01 17:37:52 UTC
Update a resource file
Hi
I would like to create a bundle, that contain only a resource file (without
java code). Is it possible? If yes, can you tell me how? How can I update
such bundle?
Thank you
Antonio
--
View this message in context: http://www.nabble.com/Update-a-resource-file-tp18218985p18218985.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org
Re: Update a resource file
Posted by ribeiant <ri...@students.zhaw.ch>.
Thank you very much!
it's work :-) !
regards
Antonio
Richard S. Hall wrote:
>
> Assume that you have a file like "config.xml" and the structure of your
> bundle is like this:
>
> org/
> foo/
> resource/
> config.xml
>
> The only thing you need to do to make this available for to other
> bundles is put the following in your bundle's manifest:
>
> Export-Package: org.foo.resource
>
> Now the bundles wanting to use this file have to have this in their
> manifest:
>
> Import-Package: org.foo.resource
>
> So the above is exactly as if it were code. To actually use it, they
> would have to do something like:
>
> this.getClass().getResource("org/foo/resource/config.xml");
>
> This will give them a URL to the resource which they can then read the
> content from an input stream. That's it.
>
> -> richard
>
> ribeiant wrote:
>> Thank you for the answer. The update works and the bundle with only a
>> file
>> will be updated correctly.
>> But now I have another problem. I would like that the other bundles use
>> this
>> file. How can I import this file, so that the others bundles can use it?
>> Thank you for help
>> Antonio
>>
>>
>> Richard S. Hall wrote:
>>
>>> Creating such a bundle is the same as creating any bundle. You would
>>> just organize your resources into packages as if they were code and
>>> export the packages of the resources that you want to be externally
>>> visible. Updating such a bundle is the same as if it had code.
>>>
>>> -> richard
>>>
>>> ribeiant wrote:
>>>
>>>> Hi
>>>> I would like to create a bundle, that contain only a resource file
>>>> (without
>>>> java code). Is it possible? If yes, can you tell me how? How can I
>>>> update
>>>> such bundle?
>>>> Thank you
>>>> Antonio
>>>>
>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>> For additional commands, e-mail: users-help@felix.apache.org
>>>
>>>
>>>
>>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>
>
--
View this message in context: http://www.nabble.com/Update-a-resource-file-tp18218985p18652417.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org
Re: Update a resource file
Posted by "Richard S. Hall" <he...@ungoverned.org>.
Assume that you have a file like "config.xml" and the structure of your
bundle is like this:
org/
foo/
resource/
config.xml
The only thing you need to do to make this available for to other
bundles is put the following in your bundle's manifest:
Export-Package: org.foo.resource
Now the bundles wanting to use this file have to have this in their
manifest:
Import-Package: org.foo.resource
So the above is exactly as if it were code. To actually use it, they
would have to do something like:
this.getClass().getResource("org/foo/resource/config.xml");
This will give them a URL to the resource which they can then read the
content from an input stream. That's it.
-> richard
ribeiant wrote:
> Thank you for the answer. The update works and the bundle with only a file
> will be updated correctly.
> But now I have another problem. I would like that the other bundles use this
> file. How can I import this file, so that the others bundles can use it?
> Thank you for help
> Antonio
>
>
> Richard S. Hall wrote:
>
>> Creating such a bundle is the same as creating any bundle. You would
>> just organize your resources into packages as if they were code and
>> export the packages of the resources that you want to be externally
>> visible. Updating such a bundle is the same as if it had code.
>>
>> -> richard
>>
>> ribeiant wrote:
>>
>>> Hi
>>> I would like to create a bundle, that contain only a resource file
>>> (without
>>> java code). Is it possible? If yes, can you tell me how? How can I update
>>> such bundle?
>>> Thank you
>>> Antonio
>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>>
>>
>>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org
Re: Update a resource file
Posted by ribeiant <ri...@students.zhaw.ch>.
Thank you for the answer. The update works and the bundle with only a file
will be updated correctly.
But now I have another problem. I would like that the other bundles use this
file. How can I import this file, so that the others bundles can use it?
Thank you for help
Antonio
Richard S. Hall wrote:
>
> Creating such a bundle is the same as creating any bundle. You would
> just organize your resources into packages as if they were code and
> export the packages of the resources that you want to be externally
> visible. Updating such a bundle is the same as if it had code.
>
> -> richard
>
> ribeiant wrote:
>> Hi
>> I would like to create a bundle, that contain only a resource file
>> (without
>> java code). Is it possible? If yes, can you tell me how? How can I update
>> such bundle?
>> Thank you
>> Antonio
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>
>
--
View this message in context: http://www.nabble.com/Update-a-resource-file-tp18218985p18651793.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org
Re: Update a resource file
Posted by "Richard S. Hall" <he...@ungoverned.org>.
Creating such a bundle is the same as creating any bundle. You would
just organize your resources into packages as if they were code and
export the packages of the resources that you want to be externally
visible. Updating such a bundle is the same as if it had code.
-> richard
ribeiant wrote:
> Hi
> I would like to create a bundle, that contain only a resource file (without
> java code). Is it possible? If yes, can you tell me how? How can I update
> such bundle?
> Thank you
> Antonio
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org