I didn't test remote file download/upload, but all tests are green.
The exist() replacement code is duplicated : it would be better to refactor in a namespace that can be used everywhere, but IMO this can be done later.
Please test further and tell me if i can merge this.