I have some difficulties with naming the database and place it, with the "server" file system.
I try this:
filesystem = new FileSystemDriver(FileName,null,null,@"MySubDirectory/");
At first, I had an exception when I gave that directory name: "MyDirectoryName" because there was no "/" at the end. Because
...Sterling.Server.FileSystem.PathProvider.cs line 38 (in release 78667) does this test : "if (!basePath.EndsWith(@"/"))".
I really don't understand the utility of this test. At least I suggest to add an information to the exception, of this kind: "throw new ArgumentOutOfRangeException("basePath","There is no '/' at the end of the directory\n Please add
one");", to help programmers.
After having fixed this problem, Sterling (1.5) refuses to take the database
name into account, this time.
After some research it appears that:
1. the name is superbly ignored by SterlingDatabase.cs line 270: "driver.DatabaseName = database.Name;"
where database.Name is not the name we provided but the type of the registring class that inherites
BaseDatabaseInstance (which is, in my case, a general, but not generic, name absolutely useless to identify the database).
2. Anyway, the name is hashed at the end by ....Sterling.Server.FileSystem.PathProvider.cs at line 108 (in release 78667) :
var path = Path.Combine(RootPath, basePath, databaseName.GetHashCode().ToString()) + "/";"
I do not understand why Sterling does not simply use the databaseName provided by the user as the database sub-directory name (as it should be normally).
This way Sterling would create one directory for the "filesystem", using "basePath", and a sub-directory for each database using "databaseName" (but this one should be provided when calling RegisterDatabase, not FileSystemDriver).
Thank you for your attention, I hope that could help some of you.
(because you can spend hours fighting that way) ;)