Xceed .NET Libraries Documentation
CopyFilesTo(AbstractFile,Boolean) Method


Xceed.GZip Assembly > Xceed.GZip Namespace > GZipArchive Class > CopyFilesTo Method : CopyFilesTo(AbstractFile,Boolean) Method
An AbstractFile object that represents the file to which the archive's files must be copied. Cannot be a null reference (Nothing in Visual Basic).
true if the destination file should be overwritten if it already exists; false otherwise.
Extracts all the archive's files to a destination file.
Syntax
'Declaration
 
Public Overloads Sub CopyFilesTo( _
   ByVal destinationFile As AbstractFile, _
   ByVal overwrite As Boolean _
) 
'Usage
 
Dim instance As GZipArchive
Dim destinationFile As AbstractFile
Dim overwrite As Boolean
 
instance.CopyFilesTo(destinationFile, overwrite)
public void CopyFilesTo( 
   AbstractFile destinationFile,
   bool overwrite
)

Parameters

destinationFile
An AbstractFile object that represents the file to which the archive's files must be copied. Cannot be a null reference (Nothing in Visual Basic).
overwrite
true if the destination file should be overwritten if it already exists; false otherwise.
Exceptions
ExceptionDescription
Thrown if destinationFile is a null reference (Nothing in Visual Basic).
Thrown if destinationFile already exists and overwrite is false.
Thrown if destinationFile exists and its attributes have the System.IO.FileAttributes.ReadOnly bit set.
Thown if an I/O exception occurred while copying the data from an item to the destination file.
Remarks

This method is to be used when dealing with GZip archives that are made up of multiple files, but these files are just segments of a single source file that has been split into multiple segments. The goal then, is to extract all the segments and concatenate them into a single destination file.

This method performs that work, as opposed to the regular flavors of CopyFilesTo take an AbstractFolder as the destination and treat each file in the archive as a separate file to extract.

The method always extracts all files in the archive. Filters are not supported as they make no sense in this context.

If the AllowMultipleFiles Property value is false, only the first file will be extracted.

Example
Extract multi-file GZip archive to a single file
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

GZipArchive Class
GZipArchive Members
Overload List