@staticmethod
def _process_backup_data(data, compressor, encryptor, do_compress=True):
    """Compresses and encrypts provided data according to args"""
    if do_compress:
        data = compressor.compress(data)
    if encryptor:
        data = encryptor.encrypt(data)
    return data
