IOException when getting remote resource