[Pljava-dev] reading a file

From: thhal at mailblocks(dot)com (Thomas Hallgren)
To:
Subject: [Pljava-dev] reading a file
Date: 2004-11-12 00:15:04
Message-ID: thhal-0DJlvArllby4N0xum73Vmh65wFV0FHU@mailblocks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pljava-dev

Russell Reeves wrote:

>Hi Thomas,
>Thanks for the reply.
>Please bear with me. I'm a newbie with pljava and Postgres.
>So, if I have a jar file up in Postgres with a class that is trying to read
>a file in,
>where does it look by default?
>I think I can use what you suggested.
>I'll let you know what happens.
>Many thanks,
>Russ
>
>
Radu-Adrian Popescu wrote:

> I guess you can always use the classloader resource mechanism, and
> locate the property file[s] near your classes or in the jar.

If you are referring to the Class methods "getResource" and
"getResourceAsStream", i.e. the stuff that Radu-Adrian mentioned, I must
admit that there's a minor flaw in PL/Java at present. The resource
finder semantics are not yet implemented in the ClassLoader.

The behavior that will be implemented in the coming release is to mimic
the behavior of the standard Java ClassLoader and resolve the resource
the same way as the class is resolved, i.e. by consulting the classpath.
In PL/Java, the classpath is defined for the schema where the executing
function is defined (as set by the function set_classpath).

Regards,
Thomas Hallgren

Browse pljava-dev by date

  From Date Subject
Next Message p3consulting 2004-11-12 09:05:26 [Pljava-dev] FYI: pljava-1.0.0b5 on Mac OS X 10.3.6
Previous Message Radu-Adrian Popescu 2004-11-11 20:46:37 [Pljava-dev] reading a file