C# 클래스 EnterpriseWebLibrary.IO.ZipOps

Contains methods that zip and unzip data.
파일 보기 프로젝트 열기: enduracode/enterprise-web-library

공개 메소드들

메소드 설명
UnZipByteArrayAsFolder ( byte sourceData, string destinationFolderPath ) : void

Unzips the specified ZIP byte array into a new folder with the specified path. If a folder already exists at the path, it is deleted.

UnZipFileAsFolder ( string sourceFilePath, string destinationFolderPath ) : void

Unzips the specified ZIP file into a new folder with the specified path. If a folder already exists at the path, it is deleted.

UnZipStreamAsFileObjects ( Stream source ) : IEnumerable

This method completely ignores directory structure of the zip file in the source stream. The result is a flattened list of files. But, the file names do contain the relative path information, so they can be used to re-create the directory structure.

UnZipStreamAsFolder ( Stream sourceStream, string destinationFolderPath ) : void

Unzips the specified ZIP stream into a new folder with the specified path. If a folder already exists at the path, it is deleted.

UnZipStreamIntoFolder ( Stream sourceStream, string destinationFolderPath ) : void

Unzips the specified ZIP stream to the new or existing folder. If the folder already exists, archive items will be added to the existing folder structure. Files will be overwritten when there is an existing file with the same name as an archive file.

ZipFileObjectsAsStream ( IEnumerable files, Stream destination ) : void

Creates a zip file into the destination stream, given the sources. Tuple file names will be cleaned. File names must include extension.

ZipFileStreamsAsStream ( Stream>.IEnumerable fileNameAndSources, Stream destination ) : void

Creates a zip file into the destination stream, given the sources. Tuple file names will be cleaned. File names must include extension.

ZipFilesAsStream ( IEnumerable filePaths, Stream outputStream ) : void

Zips all specified files into a stream. All files are put in the root of the zip file. The caller is responsible for disposing the stream.

ZipFolderAsByteArray ( string sourceFolderPath ) : byte[]

Zips all files and folders (recursively) in the specified folder into a ZIP byte array that represents a zip file.

ZipFolderAsFile ( string sourceFolderPath, string destinationFilePath ) : void

Zips all files in the specified folder into a new ZIP file with the specified path. If a file already exists at the path, it is overwritten.

ZipFolderAsStream ( string sourceFolderPath, Stream outputStream ) : void

Zips all files and folders (recursively) in the specified folder into a memory stream. The caller is responsible for disposing the stream.

비공개 메소드들

메소드 설명
Test ( ) : void
createZipOutputStream ( Stream s ) : ZipOutputStream
writeZipEntry ( ZipEntry zipEntry, Stream sourceStream, ZipOutputStream zipOutputStream ) : void

메소드 상세

UnZipByteArrayAsFolder() 공개 정적인 메소드

Unzips the specified ZIP byte array into a new folder with the specified path. If a folder already exists at the path, it is deleted.
public static UnZipByteArrayAsFolder ( byte sourceData, string destinationFolderPath ) : void
sourceData byte
destinationFolderPath string
리턴 void

UnZipFileAsFolder() 공개 정적인 메소드

Unzips the specified ZIP file into a new folder with the specified path. If a folder already exists at the path, it is deleted.
public static UnZipFileAsFolder ( string sourceFilePath, string destinationFolderPath ) : void
sourceFilePath string
destinationFolderPath string
리턴 void

UnZipStreamAsFileObjects() 공개 정적인 메소드

This method completely ignores directory structure of the zip file in the source stream. The result is a flattened list of files. But, the file names do contain the relative path information, so they can be used to re-create the directory structure.
public static UnZipStreamAsFileObjects ( Stream source ) : IEnumerable
source Stream
리턴 IEnumerable

UnZipStreamAsFolder() 공개 정적인 메소드

Unzips the specified ZIP stream into a new folder with the specified path. If a folder already exists at the path, it is deleted.
public static UnZipStreamAsFolder ( Stream sourceStream, string destinationFolderPath ) : void
sourceStream Stream
destinationFolderPath string
리턴 void

UnZipStreamIntoFolder() 공개 정적인 메소드

Unzips the specified ZIP stream to the new or existing folder. If the folder already exists, archive items will be added to the existing folder structure. Files will be overwritten when there is an existing file with the same name as an archive file.
public static UnZipStreamIntoFolder ( Stream sourceStream, string destinationFolderPath ) : void
sourceStream Stream
destinationFolderPath string
리턴 void

ZipFileObjectsAsStream() 공개 정적인 메소드

Creates a zip file into the destination stream, given the sources. Tuple file names will be cleaned. File names must include extension.
public static ZipFileObjectsAsStream ( IEnumerable files, Stream destination ) : void
files IEnumerable
destination Stream
리턴 void

ZipFileStreamsAsStream() 공개 정적인 메소드

Creates a zip file into the destination stream, given the sources. Tuple file names will be cleaned. File names must include extension.
public static ZipFileStreamsAsStream ( Stream>.IEnumerable fileNameAndSources, Stream destination ) : void
fileNameAndSources Stream>.IEnumerable
destination Stream
리턴 void

ZipFilesAsStream() 공개 정적인 메소드

Zips all specified files into a stream. All files are put in the root of the zip file. The caller is responsible for disposing the stream.
public static ZipFilesAsStream ( IEnumerable filePaths, Stream outputStream ) : void
filePaths IEnumerable
outputStream Stream
리턴 void

ZipFolderAsByteArray() 공개 정적인 메소드

Zips all files and folders (recursively) in the specified folder into a ZIP byte array that represents a zip file.
public static ZipFolderAsByteArray ( string sourceFolderPath ) : byte[]
sourceFolderPath string
리턴 byte[]

ZipFolderAsFile() 공개 정적인 메소드

Zips all files in the specified folder into a new ZIP file with the specified path. If a file already exists at the path, it is overwritten.
public static ZipFolderAsFile ( string sourceFolderPath, string destinationFilePath ) : void
sourceFolderPath string
destinationFilePath string
리턴 void

ZipFolderAsStream() 공개 정적인 메소드

Zips all files and folders (recursively) in the specified folder into a memory stream. The caller is responsible for disposing the stream.
public static ZipFolderAsStream ( string sourceFolderPath, Stream outputStream ) : void
sourceFolderPath string
outputStream Stream
리턴 void