C# Class Fluent.Zip.ZipExtensions

A set of FluentPath extensions that surface SharpZipLib features. This API is unsuitable to zip very large files: streaming is not implemented yet. If you need to zip big files, please use the SharpZipLib API directly.
Datei anzeigen Open project: bleroy/FluentPath

Public Methods

Method Description
Unzip ( this path, byte[]>.Action unzipAction ) : Fluent.IO.Path

Unzips all files in the path.

Unzip ( this path, Fluent.IO.Path target ) : Fluent.IO.Path

Unzips all files in the path.

Unzip ( Stream zip, byte[]>.Action unzipAction ) : void

Unzips a stream and calls an action for each unzipped file.

Unzip ( byte zip, byte[]>.Action unzipAction ) : void

Unzips a byte array and calls an action for each unzipped file.

Zip ( this path, Fluent.IO.Path target ) : Fluent.IO.Path

Zips all files in the path to the target. When a directory is being pointed to as a source, all contents are recursively added. Individual files are added at the root, and directories are added at the root under their name. To have more control over the path of the files in the zip, use the overload.

Zip ( this path, Fluent.IO.Path target, Path>.Func fileSystemToZip ) : Fluent.IO.Path

Zips all files in the path to the target.

Zip ( this target, Fluent.IO.Path zipPaths, byte[]>.Func zipPathToContent ) : Fluent.IO.Path

Zips dynamically created contents.

Zip ( this target, byte[]>.IDictionary contents ) : Fluent.IO.Path

Zips the contents of a dictionary of paths to byte arrays.

Zip ( Fluent.IO.Path zipPaths, byte[]>.Func zipPathToContent ) : byte[]
Zip ( this filesToZip ) : byte[]

Zips the files in the path into a byte array.

ZipToStream ( Fluent.IO.Path zipPaths, byte[]>.Func zipPathToContent, Stream output ) : void

Method Details

Unzip() public static method

Unzips all files in the path.
public static Unzip ( this path, byte[]>.Action unzipAction ) : Fluent.IO.Path
path this The zip files.
unzipAction byte[]>.Action An action that handles the unzipping of each file.
return Fluent.IO.Path

Unzip() public static method

Unzips all files in the path.
public static Unzip ( this path, Fluent.IO.Path target ) : Fluent.IO.Path
path this The zip files.
target Fluent.IO.Path The directory where the files must be unzipped.
return Fluent.IO.Path

Unzip() public static method

Unzips a stream and calls an action for each unzipped file.
public static Unzip ( Stream zip, byte[]>.Action unzipAction ) : void
zip Stream The zip byte array.
unzipAction byte[]>.Action The action to perform with each unzipped file.
return void

Unzip() public static method

Unzips a byte array and calls an action for each unzipped file.
public static Unzip ( byte zip, byte[]>.Action unzipAction ) : void
zip byte The zip byte array.
unzipAction byte[]>.Action The action to perform with each unzipped file.
return void

Zip() public static method

Zips all files in the path to the target. When a directory is being pointed to as a source, all contents are recursively added. Individual files are added at the root, and directories are added at the root under their name. To have more control over the path of the files in the zip, use the overload.
public static Zip ( this path, Fluent.IO.Path target ) : Fluent.IO.Path
path this The files to compress.
target Fluent.IO.Path /// The path of the target zip file. /// If target has more than one file, only the first one is used. ///
return Fluent.IO.Path

Zip() public static method

Zips all files in the path to the target.
public static Zip ( this path, Fluent.IO.Path target, Path>.Func fileSystemToZip ) : Fluent.IO.Path
path this The files to compress.
target Fluent.IO.Path /// The path of the target zip file. /// If target has more than one file, only the first one is used.
fileSystemToZip Path>.Func /// A function that maps the paths of the files and directories to zip into relative paths inside the zip. ///
return Fluent.IO.Path

Zip() public static method

Zips dynamically created contents.
public static Zip ( this target, Fluent.IO.Path zipPaths, byte[]>.Func zipPathToContent ) : Fluent.IO.Path
target this /// The path of the target zip file. /// If target has more than one file, only the first one is used.
zipPaths Fluent.IO.Path The zipped paths of the files to zip.
zipPathToContent byte[]>.Func /// A function that maps the zipped paths to the binary content of the file to zip. ///
return Fluent.IO.Path

Zip() public static method

Zips the contents of a dictionary of paths to byte arrays.
public static Zip ( this target, byte[]>.IDictionary contents ) : Fluent.IO.Path
target this The path of the zip file to build.
contents byte[]>.IDictionary The contents to zip.
return Fluent.IO.Path

Zip() public static method

public static Zip ( Fluent.IO.Path zipPaths, byte[]>.Func zipPathToContent ) : byte[]
zipPaths Fluent.IO.Path
zipPathToContent byte[]>.Func
return byte[]

Zip() public static method

Zips the files in the path into a byte array.
public static Zip ( this filesToZip ) : byte[]
filesToZip this The list of files to zip
return byte[]

ZipToStream() public static method

public static ZipToStream ( Fluent.IO.Path zipPaths, byte[]>.Func zipPathToContent, Stream output ) : void
zipPaths Fluent.IO.Path
zipPathToContent byte[]>.Func
output Stream
return void