Figure 1. Simplifying file access.
Treating all files alike requires routing requests through a common component. In this case, StreamFactory wraps WebRequest and creates a Stream instance given a URL and, optionally, user credentials.