I think Steve Solomon wrote:
> Hi,
> 
>  
> 
> I'm deploying a Jess source file in a jar file. The Rete.batch method
> takes a String filename argument. However, in this case I don't have
> access to the file system. I am reading the data from within the jar
> using the ClassLoader.getResourceAsStream function, which returns an
> InputStream. Do you have a suggestion how I can read the program rules
> contained in the .clp resource using an InputStream as input?
> 


It actually already does that. From the Jess 7.0b7 manual, section
16.23:

    ... In any program, if the file is not found [by the batch function],
    the name is then passed to
    ClassLoader.getSystemResourceAsStream(). This allows files along the
    class path, including files in JARs, to be batched.

You could also, if this doesn't work because you're doing something
especally tricky with ClassLoaders, just use the jess.Jesp parser
class directly; batch is just a fairly thin wrapper around this
class's parse() method.

---------------------------------------------------------
Ernest Friedman-Hill  
Advanced Software Research          Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
PO Box 969, MS 9012                 [EMAIL PROTECTED]
Livermore, CA 94550         http://herzberg.ca.sandia.gov

--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------

Reply via email to