new class UploadState, use it in FileCopy; move max_retries to FileAccess