public bool Exists(string gameName, string targetFilePath, long size) { ValidateFtpClient(); try { string gameRoot = Path.Combine(_ftpXboxSettings.GameRootDirectory, gameName); string path = Path.Combine(gameRoot, targetFilePath); // For FileExist or GetObjectInfo to work, the current working directory must be the drive // where the file exists SetWorkingDirectory(_ftpXboxSettings.GameRootDirectory); // Due to a bug in the FluentFtp library, must convert \\ from Path.Combine to / string newPath = ConvertPath(path); FtpListItem fileInfo = _ftpClient.GetObjectInfo(newPath); if (fileInfo == null) { return(false); } if (fileInfo.Size == size) { return(true); } } catch (FtpCommandException ex) { if (ex.CompletionCode == "550") // Failed to change directory { return(false); } throw new XboxFtp.Core.Ports.Persistence.PersistenceException("Unhandled FTP exception", ex); } catch (Exception ex) { return(false); } return(false); }