public virtual IFileSystem ResolveFileSystem(string uri, FileSystemOptions options = null)
		{
			var node = this.Resolve(uri, NodeType.Directory, AddressScope.FileSystem, options);

			if (node.Address.AbsolutePath != "/")
			{
				throw new UriFormatException($"Expected root directory in uri: ${uri}");
			}
			
			return node.FileSystem;
		}
		public abstract INode Resolve(string uri, NodeType nodeType, AddressScope scope, FileSystemOptions options = null);
コード例 #3
0
 public abstract INode Resolve(string uri, NodeType nodeType, AddressScope scope, FileSystemOptions options);
		public override INode Resolve(string uri, NodeType nodeType, AddressScope scope, FileSystemOptions options)
		{						
			if (uri.IsNullOrEmpty())
			{
				if (uri == null)
				{
					throw new ArgumentNullException("uri");
				}
				else
				{
					throw new ArgumentException("uri");
				}
			}

			if (uri[0] == ' ')
			{
				uri = uri.Trim();
			}

			if (uri.Length == 0)
			{
				throw new ArgumentException(uri, "uri");
			}
						
			foreach (var provider in providers)
			{
				if (provider.SupportsUri(uri))
				{
					return provider.Find(this, uri, nodeType, options);
				}
			}

			throw new NotSupportedException(uri);
		}
        public override INode Resolve(string uri, NodeType nodeType, AddressScope scope, FileSystemOptions options)
        {
            if (uri.IsNullOrEmpty())
            {
                if (uri == null)
                {
                    throw new ArgumentNullException(nameof(uri));
                }
                else
                {
                    throw new ArgumentException(nameof(uri));
                }
            }

            if (uri[0] == ' ')
            {
                uri = uri.Trim();
            }

            if (uri.Length == 0)
            {
                throw new ArgumentException(uri, nameof(uri));
            }

            foreach (var provider in this.providers.Where(provider => provider.SupportsUri(uri)))
            {
                return(provider.Find(this, uri, nodeType, options));
            }

            throw new NotSupportedException(uri);
        }