You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@uima.apache.org by Alexandre Patry <al...@keatext.com> on 2014/08/07 17:37:54 UTC

Loading a resource from the classpath

Hi,

I would like to locate a resource in the classpath, something along the 
lines of:

<externalResource>
   <name>LocationDictionary</name>
   <description>Dictionary of locations</description>
   <fileResourceSpecifier>
     <!-- Search this file in the classpath instead of the filesystem -->
     <fileUrl>path/in/jar/location-dictionary.xml</fileUrl>
   </fileResourceSpecifier>
   <implementationName>org.apache.uima.conceptMapper.support.dictionaryResource.DictionaryResource_impl</implementationName>
</externalResource>

Is it possible with existing resource specifiers or do I have to write 
my own and use a CustomResourceSpecifier?

Thanks!

Alexandre

-- 
Alexandre Patry, Ph.D
Chercheur Principal / Principal Researcher
http://KeaText.com


Re: Loading a resource from the classpath

Posted by Marshall Schor <ms...@schor.com>.
:-)  -Marshall
On 8/7/2014 12:26 PM, Alexandre Patry wrote:
> Well, the error was on the other side of the screen. This works perfectly well
> with fileUrl, I only had a typo in my path.
>
> On 07/08/2014 11:37, Alexandre Patry wrote:
>> Hi,
>>
>> I would like to locate a resource in the classpath, something along the lines
>> of:
>>
>> <externalResource>
>>   <name>LocationDictionary</name>
>>   <description>Dictionary of locations</description>
>>   <fileResourceSpecifier>
>>     <!-- Search this file in the classpath instead of the filesystem -->
>> <fileUrl>path/in/jar/location-dictionary.xml</fileUrl>
>>   </fileResourceSpecifier>
>> <implementationName>org.apache.uima.conceptMapper.support.dictionaryResource.DictionaryResource_impl</implementationName>
>>
>> </externalResource>
>>
>> Is it possible with existing resource specifiers or do I have to write my own
>> and use a CustomResourceSpecifier?
>>
>> Thanks!
>>
>> Alexandre
>>
>
>


Re: Loading a resource from the classpath

Posted by Alexandre Patry <al...@keatext.com>.
Well, the error was on the other side of the screen. This works 
perfectly well with fileUrl, I only had a typo in my path.

On 07/08/2014 11:37, Alexandre Patry wrote:
> Hi,
>
> I would like to locate a resource in the classpath, something along 
> the lines of:
>
> <externalResource>
>   <name>LocationDictionary</name>
>   <description>Dictionary of locations</description>
>   <fileResourceSpecifier>
>     <!-- Search this file in the classpath instead of the filesystem -->
> <fileUrl>path/in/jar/location-dictionary.xml</fileUrl>
>   </fileResourceSpecifier>
> <implementationName>org.apache.uima.conceptMapper.support.dictionaryResource.DictionaryResource_impl</implementationName>
> </externalResource>
>
> Is it possible with existing resource specifiers or do I have to write 
> my own and use a CustomResourceSpecifier?
>
> Thanks!
>
> Alexandre
>


-- 
Alexandre Patry, Ph.D
Chercheur Principal / Principal Researcher
http://KeaText.com