presto-raptor-legacy/src/main/java/io/prestosql/plugin/raptor/legacy/backup/FileBackupStore.java/FileBackupStore/backupShard
class FileBackupStore:    @Override
    public void backupShard(UUID uuid, File source)
    {
        File backupFile = getBackupFile(uuid);

        try {
            try {
                // Optimistically assume the file can be created
                copyFile(source, backupFile);
            }
            catch (FileNotFoundException e) {
                createDirectories(backupFile.getParentFile());
                copyFile(source, backupFile);
            }
        }
        catch (IOException e) {
            throw new PrestoException(RAPTOR_BACKUP_ERROR, "Failed to create backup shard file", e);
        }
    }