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


Xceed.GZip Assembly > Xceed.GZip Namespace > GZipArchive Class > CopyFilesTo Method : CopyFilesTo(FileSystemEvents,Object,AbstractFile,Boolean) Method
FileSystemEvents object that will be used to raise events. Cannot be a null reference (Nothing in Visual Basic).
Opaque data that will be passed back to the event handler when an event is raised.
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, and raises events during the process.
Syntax
'Declaration
 
Public Overloads Sub CopyFilesTo( _
   ByVal events As FileSystemEvents, _
   ByVal userData As Object, _
   ByVal destinationFile As AbstractFile, _
   ByVal overwrite As Boolean _
) 
'Usage
 
Dim instance As GZipArchive
Dim events As FileSystemEvents
Dim userData As Object
Dim destinationFile As AbstractFile
Dim overwrite As Boolean
 
instance.CopyFilesTo(events, userData, destinationFile, overwrite)
public void CopyFilesTo( 
   FileSystemEvents events,
   object userData,
   AbstractFile destinationFile,
   bool overwrite
)

Parameters

events
FileSystemEvents object that will be used to raise events. Cannot be a null reference (Nothing in Visual Basic).
userData
Opaque data that will be passed back to the event handler when an event is raised.
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 events or 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.

If the ItemException event is handled for this method, the ItemExceptionAction.Retry behavior will be to restart the entire extraction process from the beginning, not just the current segment.

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