Yes, I was afraid this solution was the only way of checking TDB existence.

Thanks for the answer !

Nicolas

On 26 March 2012 16:43, Andy Seaborne <[email protected]> wrote:

> On 23/03/12 16:46, Nicolas Nobelis wrote:
>
>> Hello all,
>>
>>
>> I'm currently writing a graphical app that allows the user to connect to a
>> TDB and run Sparql queries against it.
>>
>> So, the user chooses a directory and then I call
>> TDBFactory.createDataset(**String dir) to connect to it.
>>
>> My problem is that this method creates the TDB if the directory is empty
>> (this is said in the Javadoc "Create or connect to a TDB-backed dataset").
>>
>> I would prefer a method that only tries to connect to the TDB, and throws
>> an exception if no valid TDB has been found in this directory. Does such a
>> method exist ? I'll looked in the TDB Javadoc but I didn't find any...
>>
>
> There's no such method in TDB but you can write a small code segment that
> tests for whether the directory exists and whether some key file (such as
> "nodes.dat") exists.
>
>        Andy
>

Reply via email to