// Atsushi Enomoto (atsushi@ximian.com)
//
// (C) 2001 Jason Diamond http://injektilo.org/
-// (C) 2004 Novell Inc.
+// Copyright (C) 2004,2009 Novell, Inc (http://www.novell.com)
//
//
{
public abstract class XmlResolver
{
+#if !MOONLIGHT
public abstract ICredentials Credentials { set; }
+#endif
public abstract object GetEntity (
Uri absoluteUri,
if (baseUri == null) {
if (relativeUri == null)
throw new ArgumentNullException ("Either baseUri or relativeUri are required.");
+#if MOONLIGHT
+ return new Uri (relativeUri, UriKind.RelativeOrAbsolute);
+#else
// Don't ignore such case that relativeUri is in fact absolute uri (e.g. ResolveUri (null, "http://foo.com")).
if (relativeUri.StartsWith ("http:") ||
relativeUri.StartsWith ("https:") ||
+ relativeUri.StartsWith ("ftp:") ||
relativeUri.StartsWith ("file:"))
return new Uri (relativeUri);
else
- // extraneous "/a" is required because current Uri stuff
- // seems ignorant of difference between "." and "./".
- // I'd be appleciate if it is fixed with better solution.
return new Uri (Path.GetFullPath (relativeUri));
-// return new Uri (new Uri (Path.GetFullPath ("./a")), EscapeRelativeUriBody (relativeUri));
+#endif
}
if (relativeUri == null)
.Replace ("%", "%25")
.Replace ("\"", "%22");
}
+#if MOONLIGHT
+ public virtual bool SupportsType (Uri absoluteUri, Type type)
+ {
+ if (absoluteUri == null)
+ throw new ArgumentNullException ("absoluteUri");
+ return ((type == null) || (type == typeof (Stream)));
+ }
+#endif
}
}