chum of chance
chum of chance

Reputation: 6300

How to retrieve the full directory path from Lucene.Net.Store.Directory?

I'm trying to access the directory path from Lucene.Net.Store.Directory, and I can't find any properties where it exists. If I call ToString() I see the path along with the type name, etc. and I would just like the path.

Upvotes: 1

Views: 567

Answers (1)

rae1
rae1

Reputation: 6144

The Lucene.Net.Store.Directory class does not have a DirectoryInfo (or Directory) property since its a abstract class and does not directly access the file system, with even some derived classes not using the file system at all to store the index (take for instance the RAMDirectory).

However, for the Lucene.Net.Store.SimpleFSDirectory directory class, you can access the Directory property, type DirectoryInfo and then its FullName property to get the absolute directory path in use,

var directoryInfo = simpleFSDirectory.Directory;
var fullPath = directoryInfo.FullName;

Upvotes: 2

Related Questions