FAES/Packaging/Compressors/LegacyZIP.cs
/// <summary>
/// Compress (LGYZIP) an unencrypted FAES File.
/// </summary>
/// <param name="unencryptedFile">Unencrypted FAES File</param>
/// <param name="percentComplete">Percent complete for compression</param>
/// <returns>Path of the unencrypted, LGYZIP compressed file</returns>
Compress (LGYZIP) an unencrypted FAES File.
Compress ( LGYZIP ) an unencrypted FAES File .
public string CompressFAESFile(FAES_File unencryptedFile, ref decimal percentComplete)
        {
            FileAES_IntUtilities.CreateEncryptionFilePath(unencryptedFile, "LGYZIP", out string tempRawPath, out _, out string tempOutputPath);
            Logging.Log("LGYZIP does not support percent complete reporting!", Severity.WARN);
            percentComplete = 99;
            if (unencryptedFile.IsFile())
            {
                using (ZipArchive zip = ZipFile.Open(tempOutputPath, ZipArchiveMode.Create))
                {
                    zip.CreateEntryFromFile(unencryptedFile.GetPath(), unencryptedFile.GetFileName());
                    zip.Dispose();
                }
            }
            else
            {
                FileAES_IntUtilities.DirectoryCopy(unencryptedFile.GetPath(), tempRawPath);
                ZipFile.CreateFromDirectory(tempRawPath, tempOutputPath);
            }
            return tempOutputPath;
        }
public string CompressFAESFile ( FAES_File unencryptedFile , ref decimal percentComplete ) { FileAES_IntUtilities . CreateEncryptionFilePath ( unencryptedFile , " " , out string tempRawPath , out _ , out string tempOutputPath ) ; Logging . Log ( " " , Severity . WARN ) ; percentComplete = 99 ; if ( unencryptedFile . IsFile ( ) ) { using ( ZipArchive zip = ZipFile . Open ( tempOutputPath , ZipArchiveMode . Create ) ) { zip . CreateEntryFromFile ( unencryptedFile . GetPath ( ) , unencryptedFile . GetFileName ( ) ) ; zip . Dispose ( ) ; } } else { FileAES_IntUtilities . DirectoryCopy ( unencryptedFile . GetPath ( ) , tempRawPath ) ; ZipFile . CreateFromDirectory ( tempRawPath , tempOutputPath ) ; } return tempOutputPath ; }
Compress (LGYZIP) an unencrypted FAES File.
Compress ( LGYZIP ) an unencrypted FAES File .
Path of the unencrypted, LGYZIP compressed file
Path of the unencrypted LGYZIP compressed file
unencryptedFile
FAES_File
Unencrypted FAES File
Unencrypted FAES File
decimal
ref
percentComplete
Percent complete for compression
Percent complete for compression