internal PathNode Resolve(Context context, string path) { if( _disposed) { throw new ObjectDisposedException( "MongoDrive" ); } Regex re = new Regex(@"^[-_a-z0-9:]+:/?"); path = path.Replace('\\', '/'); path = re.Replace(path, ""); PathNode factory = new RootNode(context); var nodeMonikers = path.Split(new char[] {'/'}, StringSplitOptions.RemoveEmptyEntries); foreach (var nodeMoniker in nodeMonikers) { factory = factory.Resolve(nodeMoniker); if (null == factory) { break; } } return factory; }
internal static string Create( Context context, IMongoCollection collection, string documentName ) { var driveName = context.Provider.Drive.Name; var databaseName = collection.DatabaseName; var collectionName = collection.Name; return Create(driveName, databaseName, collectionName, documentName); }
internal static string Create(Context context, IMongoDatabase database, string userName) { return Create(context, database, userName); }
internal static string Create(Context context) { var driveName = context.Provider.Drive.Name; return Create(driveName, null, null, null); }
internal static string Create(Context context, IMongoDatabase database) { var driveName = context.Provider.Drive.Name; return Create(driveName, database.Name, null, null); }