"Martin Testrot" <[EMAIL PROTECTED]> writes:

> Hello,
>
> is it possible to load a non-java resource from the classpath with:
>
>               if (!new File(pResource).exists() &&
> ClassLoader.getSystemResource(pResource) == null){
>                       System.out.println (pResource + " not found!");
>                       throw new FileNotFoundException("Description " +
> pResource + " not found!");
>               }
>

Hello,
Did you try using standard getResource instead of getSystemResource ?
According  to jdk/docs/api/java/lang/ClassLoader.html, the
getSystemResource() methods looks only in the system classloader which
may not be the right class loader to look at:

 if (!new File(pResource).exists() &&
     ClassLoader.getResource(pResource) == null){
     System.out.println (pResource + " not found!");
     throw new FileNotFoundException("Description " + pResource 
        + " not found!");
 }

HTH
-- 
OQube < software engineering \ génie logiciel >
Arnaud Bailly, Dr.
\web> http://www.oqube.com


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to