C# Class LitDev.LDZip

Show file Open project: litdev1/LitDev

Public Methods

Method Description
Remove ( Primitive zipFile, Primitive files ) : Primitive

Remove a file (or directory with all sub files) from an existing zip archive.

UnZip ( Primitive zipFile, Primitive directory ) : Primitive

Uncompress a zip archive.

Zip ( Primitive zipFile, Primitive files ) : Primitive

Compress files to a zip archive.

ZipList ( Primitive zipFile ) : Primitive

List the files in a zip archive.

Private Methods

Method Description
AddToArchive ( Package zip, string fileToAdd, string root ) : void
ExtractFile ( string rootFolder, System.IO.Packaging.ZipPackagePart contentFile ) : void
RemoveFromArchive ( ZipFile zip, string fileToRemove ) : void

Method Details

Remove() public static method

Remove a file (or directory with all sub files) from an existing zip archive.
public static Remove ( Primitive zipFile, Primitive files ) : Primitive
zipFile Primitive The zip archive to remove a file from.
files Primitive /// An array of files to remove from the zip archive. /// A single file or directory may also be deleted. /// Any directories will be recursively removed from the zip. ///
return Primitive

UnZip() public static method

Uncompress a zip archive.
public static UnZip ( Primitive zipFile, Primitive directory ) : Primitive
zipFile Primitive The zip archive to uncompress.
directory Primitive A directory to uncompress the files to (existing files will be overwritten).
return Primitive

Zip() public static method

Compress files to a zip archive.
public static Zip ( Primitive zipFile, Primitive files ) : Primitive
zipFile Primitive The zip archive file to create.
files Primitive /// An array of files to append to the zip archive. /// A single file or directory may also be set. /// Any directories will be recursively added to the zip. /// Any white space in files or directories will be replaced with "_". ///
return Primitive

ZipList() public static method

List the files in a zip archive.
public static ZipList ( Primitive zipFile ) : Primitive
zipFile Primitive The zip archive.
return Primitive