///// <summary> ///// Gets the list of user wrapper schemes. ///// </summary> ///// <returns></returns> //public static ICollection<string> GetUserWrapperSchemes() //{ // if (UserWrappers == null) // return Core.Utilities.ArrayUtils.EmptyStrings; // return UserWrappers.Keys; //} /// <summary> /// Search the lists of registered StreamWrappers to find the /// appropriate wrapper for a given scheme. When the scheme /// is empty, the FileStreamWrapper is returned. /// </summary> /// <param name="ctx">Current runtime context.</param> /// <param name="scheme">The scheme portion of an URL.</param> /// <returns>A StreamWrapper associated with the given scheme.</returns> internal static StreamWrapper GetWrapperInternal(Context ctx, string scheme) { StreamWrapper result; // Note: FileStreamWrapper is returned both for "file" and for "". if (string.IsNullOrEmpty(scheme)) { scheme = FileStreamWrapper.scheme; } // First search the system wrappers (always at least an empty Hashtable) if (!SystemStreamWrappers.TryGetValue(scheme, out result)) { // Then look if the wrapper is implemented but not instantiated switch (scheme) { case FileStreamWrapper.scheme: return((StreamWrapper)(SystemStreamWrappers[scheme] = new FileStreamWrapper())); //case HttpStreamWrapper.scheme: // return (StreamWrapper)(SystemStreamWrappers[scheme] = new HttpStreamWrapper()); //case InputOutputStreamWrapper.scheme: // return (StreamWrapper)(SystemStreamWrappers[scheme] = new InputOutputStreamWrapper()); } //// Next search the user wrappers (if present) //if (UserWrappers != null) //{ // UserWrappers.TryGetValue(scheme, out result); //} } // return(result); // can be null }
///// <summary> ///// Gets the list of user wrapper schemes. ///// </summary> ///// <returns></returns> //public static ICollection<string> GetUserWrapperSchemes() //{ // if (UserWrappers == null) // return Core.Utilities.ArrayUtils.EmptyStrings; // return UserWrappers.Keys; //} /// <summary> /// Search the lists of registered StreamWrappers to find the /// appropriate wrapper for a given scheme. When the scheme /// is empty, the FileStreamWrapper is returned. /// </summary> /// <param name="ctx">Current runtime context.</param> /// <param name="scheme">The scheme portion of an URL.</param> /// <returns>A StreamWrapper associated with the given scheme.</returns> internal static StreamWrapper GetWrapperInternal(Context ctx, string scheme) { StreamWrapper result; // Note: FileStreamWrapper is returned both for "file" and for "". if (string.IsNullOrEmpty(scheme)) { scheme = FileStreamWrapper.scheme; } // First search the system wrappers (always at least an empty Hashtable) if (!SystemStreamWrappers.TryGetValue(scheme, out result)) { // Then look if the wrapper is implemented but not instantiated switch (scheme) { case FileStreamWrapper.scheme: return (StreamWrapper)(SystemStreamWrappers[scheme] = new FileStreamWrapper()); //case HttpStreamWrapper.scheme: // return (StreamWrapper)(SystemStreamWrappers[scheme] = new HttpStreamWrapper()); //case InputOutputStreamWrapper.scheme: // return (StreamWrapper)(SystemStreamWrappers[scheme] = new InputOutputStreamWrapper()); } //// Next search the user wrappers (if present) //if (UserWrappers != null) //{ // UserWrappers.TryGetValue(scheme, out result); //} } // return result; // can be null }