Example #1
0
    public async Task ExtractAsync(string archivePath, string outputDirectory = null)
    {
        if (!CheckIfNodeIsArchive(archivePath))
        {
            throw new InvalidOperationException($"{archivePath} is not an archive!");
        }

        outputDirectory ??= _pathService.GetParentDirectory(archivePath);
        // ReSharper disable once PossibleInvalidOperationException
        var archiveType = _archiveTypeMapper.GetArchiveTypeFrom(archivePath).Value;

        await _operationsService.ExtractAsync(archivePath, outputDirectory, archiveType);
    }