예제 #1
0
        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;
        }
예제 #2
0
        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);
        }
예제 #3
0
 internal static string Create(Context context, IMongoDatabase database, string userName)
 {
     return Create(context, database, userName);
 }
예제 #4
0
 internal static string Create(Context context)
 {
     var driveName = context.Provider.Drive.Name;
     return Create(driveName, null, null, null);
 }
예제 #5
0
        internal static string Create(Context context, IMongoDatabase database)
        {
            var driveName = context.Provider.Drive.Name;

            return Create(driveName, database.Name, null, null);
        }