コード例 #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;
        }