CORE-4636: did a little bit of refactorying to prevent connections to the FTP server from lingering after the FTP URL validation is done