Handle file:// in fetcher.

Handle file:// in the fetcher, and also handle case when localhost is used.

Review: https://reviews.apache.org/r/21734