/// <summary>
        /// Unpacks an archive into a given directory.
        /// </summary>
        protected UnzipResult UnpackArchive(string archiveToUnpack, string unpackDirectory, bool isTargetDirectory)
        {
            if (isTargetDirectory)
            {
                // When the target is a directory, we need to unpack any inner archives to a subdirectory.
                unpackDirectory = Path.Combine(unpackDirectory, Path.GetFileNameWithoutExtension(archiveToUnpack));
            }

            var unzipStrategy = new UnzipStrategy(fileWhitelistPatterns, unzipNestedArchives: true);

            var unzipper = new LogsetUnzipper(unzipStrategy);

            return(unzipper.Unzip(archiveToUnpack, unpackDirectory, deleteOnFinish: isTargetDirectory));
        }
Beispiel #2
0
 public LogsetUnzipper(UnzipStrategy unzipStrategy)
     : base(unzipStrategy)
 {
 }
Beispiel #3
0
 public Unzipper(UnzipStrategy strategy)
 {
     Strategy = strategy;
 }