public void ExtractToDirectory(string sourcePath, string targetPath) { DirectoryInfo directoryInfo = new DirectoryInfo(targetPath); // Clean up the directory if it's already there before extracting, // otherwise we'll get an exception DeleteDirectoryIfExists(directoryInfo.FullName); CreateDirectoryAndParents(directoryInfo.Parent); _fileSystemOperations.ExtractToDirectory(sourcePath, targetPath); SetUnixOwnerIfNeeded(targetPath, true); }