internal Stream GetStream( Uri uri, ICredentials credentials ) { if ( uri.Scheme == "file" ) { return new FileStream( uri.LocalPath, FileMode.Open, FileAccess.Read, FileShare.Read, 1 ); } else { return GetNonFileStream( uri, credentials ); } }
// Maps a URI to an Object containing the actual resource. public override object?GetEntity(Uri absoluteUri, string?role, Type?ofObjectToReturn) { if (ofObjectToReturn is null || ofObjectToReturn == typeof(System.IO.Stream) || ofObjectToReturn == typeof(object)) { return(XmlDownloadManager.GetStream(absoluteUri, _credentials, _proxy)); } throw new XmlException(SR.Xml_UnsupportedClass, string.Empty); }