Fields (3) Events (6) Methods (9) Properties (6)
Namespace: SchwabenCode.QuickIO.Transfer

Syntax

public class QuickIOTransferFileCopyJob : QuickIOTransferJobWriteJob

Basetype

Summary

File Copy job implementation

Example

File Copy job with observer

public void CopyJobWithObserver( IQuickIOTransferObserver observer, String sourceFile, String targetDirectory, Int32 maxBufferSize )
{
var copyJob = new QuickIOTransferFileCopyJob( observer, sourceFile, targetDirectory, maxBufferSize, overwrite: true, parentExistanceCheck: true );

copyJob.CopyStarted += OnCopyStarted;
copyJob.CopyProgress += OnCopyProgress;
copyJob.CopyFinished += OnFileCopyFinished;

copyJob.Run( );
}

File copy job

public void CopyJob( String sourceFile, String targetDirectory, Int32 maxBufferSize )
{
var copyJob = new QuickIOTransferFileCopyJob( sourceFile, targetDirectory, maxBufferSize, overwrite: true, parentExistanceCheck: true );

copyJob.CopyStarted += OnCopyStarted;
copyJob.CopyProgress += OnCopyProgress;
copyJob.CopyFinished += OnFileCopyFinished;

copyJob.Run( );
}

Event definitions for this example

private static void OnFileCopyFinished( object sender, QuickIOTransferFileCopyFinishedArgs e )
{
Console.WriteLine( "TestFileCopyJob: Copy Finished." );
}

private static void OnCopyProgress( object sender, QuickIOTransferFileCopyProgressArgs e )
{
Console.WriteLine( "TestFileCopyJob: Copy progresss: " + e.Percentage.ToString( "0.00" ) );
}

private static void OnCopyStarted( object sender, QuickIOTransferFileCopyStartedArgs e )
{
Console.WriteLine( "TestFileCopyJob: Copy started." );
}

Uses

Fields

private  Boolean _copyTimestamps
private  Nullable<DateTime> _transferStarted
private readonly object _transferStartedLock

Events

DirectoryCreated

This event is raised when a directory was created

public DirectoryCreated

DirectoryCreating

This event is raised before an upcoming directory creation operation is performed

public DirectoryCreating

Error

This event is raised if file copy operation fails

public Error

Finished

This event is raised at the end of the file copy operation.

public Finished

Progress

This event is raised during a copy of a file. It provides current information such as progress, speed and estimated time.

public Progress

Started

This event is triggered at the beginning of the file copy operation.

public Started

Methods

public void QuickIOTransferFileCopyJob(IQuickIOTransferObserver observer, String source, String target, Int32 maxBufferSize, Boolean overwrite, Boolean parentExistanceCheck, Int32 prorityLevel)

Parameters

observer

IQuickIOTransferObserver

Observer

source

String

Fullname source

target

String

Fullname target

maxBufferSize

Int32

Set max buffer size for copy transfer

overwrite

Boolean

true overwrites existing files

parentExistanceCheck

Boolean

true to verify parent existance

prorityLevel

Int32

Priority level of directory creation should be higher than file creation without parent check

public void QuickIOTransferFileCopyJob(String source, String target, Int32 maxBufferSize, Boolean overwrite, Boolean parentExistanceCheck, Int32 prorityLevel)

Parameters

source

String

Fullname source

target

String

Fullname target

maxBufferSize

Int32

Set max buffer size for copy transfer

overwrite

Boolean

true overwrites existing files

parentExistanceCheck

Boolean

true to verify parent existance

prorityLevel

Int32

Priority level of directory creation should be higher than file creation without parent check

Implementation()

Executes the Copy process

protected void Implementation()
private void OnCopyFinished(Int64 totalBytes)
private void OnCopyProgress(Int64 totalBytes, UInt64 bytesTransfered)
private void OnCopyStarted(Int64 totalBytes)
private void OnDirectoryCreated(String directoryPath)
private void OnDirectoryCreating(String directoryPath)
protected void OnError(Exception e)

Parameters

e

Exception

Properties

CopyAttributes

true to copy attribute information. Default: false

public Boolean CopyAttributes { get; set; }

Remarks

Will reduce the processing speed, because a single physical access is required for each setting.

CopyTimestamps

true to copy all datetime information such as CreationTime, LastAccessTime and LastWriteTime. Default: false

public Boolean CopyTimestamps { get; set; }

Remarks

Will reduce the processing speed, because a single physical access is required for each setting.

JobType

JobType

internal override QuickIOTransferJobType JobType { get; }

Source

Fullname source

public String Source { get; set; }

Target

Fullname target

public String Target { get; set; }

TransferStarted

Transfer started

public Nullable<DateTime> TransferStarted { get; set; }

Classdiagram

public classQuickIOTransferFileCopyJob_copyTimestamps_transferStarted_transferStartedLockDirectoryCreatedDirectoryCreatingErrorFinishedProgressStartedImplementationOnCopyFinishedOnCopyProgressOnCopyStartedOnDirectoryCreatedOnDirectoryCreatingOnErrorQuickIOTransferFileCopyJobQuickIOTransferFileCopyJobCopyAttributes { get; set; }CopyTimestamps { get; set; }JobType { get; }Source { get; set; }Target { get; set; }TransferStarted { get; set; }public abstract classQuickIOTransferJobWriteJob_maxBufferSize_overwrite_parentExistanceCheckQuickIOTransferJobWriteJobQuickIOTransferJobWriteJobMaxBufferSize { get; set; }Overwrite { get; set; }ParentExistanceCheck { get; set; }public static classQuickIODirectoryAddAttributeAddAttributeAddAttributeAddAttributeAsyncAddAttributeAsyncAddAttributeAsyncCompressCompressCompressAsyncCompressAsyncCopyCopyCopyAsyncCopyAsyncCreateCreateCreateAsyncCreateAsyncDeleteDeleteDeleteAsyncDeleteAsyncEnumerateDirectoriesEnumerateDirectoriesEnumerateDirectoriesEnumerateDirectoriesAsyncEnumerateDirectoriesAsyncEnumerateDirectoriesAsyncEnumerateDirectoryPathsEnumerateDirectoryPathsEnumerateDirectoryPathsEnumerateDirectoryPathsAsyncEnumerateDirectoryPathsAsyncEnumerateDirectoryPathsAsyncEnumerateFilePathsEnumerateFilePathsEnumerateFilePathsEnumerateFilePathsAsyncEnumerateFilePathsAsyncEnumerateFilePathsAsyncEnumerateFilesEnumerateFilesEnumerateFilesEnumerateFilesAsyncEnumerateFilesAsyncEnumerateFilesAsyncEnumerateFileSystemEntriesEnumerateFileSystemEntriesEnumerateFileSystemEntriesEnumerateFileSystemEntriesAsyncEnumerateFileSystemEntriesAsyncEnumerateFileSystemEntriesAsyncEnumerateFileSystemEntryPathsEnumerateFileSystemEntryPathsEnumerateFileSystemEntryPathsEnumerateFileSystemEntryPathsAsyncEnumerateFileSystemEntryPathsAsyncEnumerateFileSystemEntryPathsAsyncExistsExistsExistsExistsAsyncExistsAsyncExistsAsyncGetAttributesGetAttributesGetAttributesGetAttributesAsyncGetAttributesAsyncGetAttributesAsyncGetCreationTimeGetCreationTimeGetCreationTimeGetCreationTimeAsyncGetCreationTimeAsyncGetCreationTimeAsyncGetCreationTimeUtcGetCreationTimeUtcGetCreationTimeUtcGetCreationTimeUtcAsyncGetCreationTimeUtcAsyncGetCreationTimeUtcAsyncGetDirectoryRootGetDirectoryRootGetDirectoryRootGetDirectoryRootAsyncGetDirectoryRootAsyncGetDirectoryRootAsyncGetLastAccessTimeGetLastAccessTimeGetLastAccessTimeGetLastAccessTimeAsyncGetLastAccessTimeAsyncGetLastAccessTimeAsyncGetLastAccessTimeUtcGetLastAccessTimeUtcGetLastAccessTimeUtcGetLastAccessTimeUtcAsyncGetLastAccessTimeUtcAsyncGetLastAccessTimeUtcAsyncGetLastWriteTimeGetLastWriteTimeGetLastWriteTimeGetLastWriteTimeAsyncGetLastWriteTimeAsyncGetLastWriteTimeAsyncGetLastWriteTimeUtcGetLastWriteTimeUtcGetLastWriteTimeUtcGetLastWriteTimeUtcAsyncGetLastWriteTimeUtcAsyncGetLastWriteTimeUtcAsyncGetMetadastaAsyncGetMetadataGetMetadataGetMetadataGetMetadataAsyncGetMetadataAsyncGetMetadataAsyncGetStatisticsGetStatisticsGetStatisticsGetStatisticsAsyncGetStatisticsAsyncGetStatisticsAsyncInternalDirectoryExistsMoveMoveAsyncRemoveAttributeRemoveAttributeRemoveAttributeRemoveAttributeAsyncRemoveAttributeAsyncRemoveAttributeAsyncSetAllFileTimesSetAllFileTimesSetAllFileTimesSetAllFileTimesAsyncSetAllFileTimesAsyncSetAllFileTimesAsyncSetAllFileTimesUtcSetAllFileTimesUtcSetAllFileTimesUtcSetAllFileTimesUtcAsyncSetAllFileTimesUtcAsyncSetAllFileTimesUtcAsyncSetAttributesSetAttributesSetAttributesSetAttributesAsyncSetAttributesAsyncSetAttributesAsyncSetCreationTimeSetCreationTimeSetCreationTimeSetCreationTimeAsyncSetCreationTimeAsyncSetCreationTimeAsyncSetCreationTimeUtcSetCreationTimeUtcSetCreationTimeUtcSetCreationTimeUtcAsyncSetCreationTimeUtcAsyncSetCreationTimeUtcAsyncSetLastAccessTimeSetLastAccessTimeSetLastAccessTimeSetLastAccessTimeAsyncSetLastAccessTimeAsyncSetLastAccessTimeAsyncSetLastAccessTimeUtcSetLastAccessTimeUtcSetLastAccessTimeUtcSetLastAccessTimeUtcAsyncSetLastAccessTimeUtcAsyncSetLastAccessTimeUtcAsyncSetLastWriteTimeSetLastWriteTimeSetLastWriteTimeSetLastWriteTimeAsyncSetLastWriteTimeAsyncSetLastWriteTimeAsyncSetLastWriteTimeUtcSetLastWriteTimeUtcSetLastWriteTimeUtcSetLastWriteTimeUtcAsyncSetLastWriteTimeUtcAsyncSetLastWriteTimeUtcAsyncpublic static classQuickIOFileAddAttributeAddAttributeAddAttributeAddAttributeAsyncAddAttributeAsyncAddAttributeAsyncAppendAllLinesAppendAllLinesAppendAllLinesAppendAllLinesAppendAllTextAppendAllTextAppendAllTextAppendAllTextCalculateHashCalculateHashCalculateMD5HashCalculateSha1HashCalculateSha256HashCalculateSha384HashCalculateSha512HashCopyCopyAsyncCopyToDirectoryCopyToDirectoryCopyToDirectoryAsyncCopyToDirectoryAsyncCreateCreateCreateCreateCreateTextCreateTextDeleteDeleteDeleteAsyncDeleteAsyncExistsExistsExistsExistsAsyncExistsAsyncExistsAsyncGetAttributesGetAttributesGetAttributesGetAttributesAsyncGetAttributesAsyncGetAttributesAsyncGetCreationTimeGetCreationTimeGetCreationTimeGetCreationTimeAsyncGetCreationTimeAsyncGetCreationTimeAsyncGetCreationTimeUtcGetCreationTimeUtcGetCreationTimeUtcGetCreationTimeUtcAsyncGetCreationTimeUtcAsyncGetCreationTimeUtcAsyncGetDirectoryRootGetDirectoryRootGetDirectoryRootGetDirectoryRootAsyncGetDirectoryRootAsyncGetDirectoryRootAsyncGetLastAccessTimeGetLastAccessTimeGetLastAccessTimeGetLastAccessTimeAsyncGetLastAccessTimeAsyncGetLastAccessTimeAsyncGetLastAccessTimeUtcGetLastAccessTimeUtcGetLastAccessTimeUtcGetLastAccessTimeUtcAsyncGetLastAccessTimeUtcAsyncGetLastAccessTimeUtcAsyncGetLastWriteTimeGetLastWriteTimeGetLastWriteTimeGetLastWriteTimeAsyncGetLastWriteTimeAsyncGetLastWriteTimeAsyncGetLastWriteTimeUtcGetLastWriteTimeUtcGetLastWriteTimeUtcGetLastWriteTimeUtcAsyncGetLastWriteTimeUtcAsyncGetLastWriteTimeUtcAsyncInternalFileExistsMoveMoveMoveMoveAsyncMoveAsyncMoveAsyncOpenOpenOpenOpenOpenOpenOpenAppendOpenAppendOpenAppendFileStreamOpenFileStreamOpenReadOpenReadOpenTextOpenTextOpenWriteOpenWriteReadAllBytesReadAllBytesReadAllLinesReadAllLinesReadAllLinesReadAllLinesReadAllTextReadAllTextReadAllTextReadAllTextRemoveAttributeRemoveAttributeRemoveAttributeRemoveAttributeAsyncRemoveAttributeAsyncRemoveAttributeAsyncSetAllFileTimesSetAllFileTimesSetAllFileTimesSetAllFileTimesAsyncSetAllFileTimesAsyncSetAllFileTimesAsyncSetAllFileTimesUtcSetAllFileTimesUtcSetAllFileTimesUtcSetAllFileTimesUtcAsyncSetAllFileTimesUtcAsyncSetAllFileTimesUtcAsyncSetAttributesSetAttributesSetAttributesSetAttributesAsyncSetAttributesAsyncSetAttributesAsyncSetCreationTimeSetCreationTimeSetCreationTimeSetCreationTimeAsyncSetCreationTimeAsyncSetCreationTimeAsyncSetCreationTimeUtcSetCreationTimeUtcSetCreationTimeUtcSetCreationTimeUtcAsyncSetCreationTimeUtcAsyncSetCreationTimeUtcAsyncSetLastAccessTimeSetLastAccessTimeSetLastAccessTimeSetLastAccessTimeAsyncSetLastAccessTimeAsyncSetLastAccessTimeAsyncSetLastAccessTimeUtcSetLastAccessTimeUtcSetLastAccessTimeUtcSetLastAccessTimeUtcAsyncSetLastAccessTimeUtcAsyncSetLastAccessTimeUtcAsyncSetLastWriteTimeSetLastWriteTimeSetLastWriteTimeSetLastWriteTimeAsyncSetLastWriteTimeAsyncSetLastWriteTimeAsyncSetLastWriteTimeUtcSetLastWriteTimeUtcSetLastWriteTimeUtcSetLastWriteTimeUtcAsyncSetLastWriteTimeUtcAsyncSetLastWriteTimeUtcAsyncWriteAllBytesWriteAllBytesWriteAllBytesWriteAllBytesWriteAllLinesWriteAllLinesWriteAllLinesWriteAllLinesWriteAllTextWriteAllTextWriteAllTextWriteAllTextpublic classQuickIOFileInfoDefaultChunkSizeAppendAllLinesAppendAllLinesAppendAllLinesAsyncAppendAllLinesAsyncAppendAllTextAppendAllTextAppendAllTextAsyncAppendAllTextAsyncAsFileInfoAsFileInfoAsyncCalculateHashCalculateHashCalculateHashAsyncCalculateHashAsyncCalculateMD5HashCalculateMD5HashAsyncCalculateSha1HashCalculateSha1HashAsyncCalculateSha256HashCalculateSha256HashAsyncCalculateSha384HashCalculateSha384HashAsyncCalculateSha512HashCalculateSha512HashAsyncCalculateSizeCompareTimestampsCompressDataCompressDataAsyncDecompressDataDecompressDataAsyncGetCompressStreamGetCompressStreamAsyncGetDecompressStreamGetDecompressStreamAsyncGetFileChunksGetFileChunksAsyncGetFileChunksEnumeratorGetFileChunksEqualGetFileChunksEqualAsyncGetFileChunksUnequalGetFileChunksUnequalAsyncGetMetadataGetMetadataAsyncInternalEnumerateFileChunksInternalGetGZipStreamInternalIsEqualTimestampCreatedInternalIsEqualTimestampLastAccessedInternalIsEqualTimestampsLastWrittenIsEqualByteLengthIsEqualContentsIsEqualContentsAsyncIsEqualTimestampCreatedIsEqualTimestampLastAccessedIsEqualTimestampsIsEqualTimestampsLastWrittenop_ExplicitOpenOpenOpenOpenAppendOpenAppendAsyncOpenAsyncOpenAsyncOpenAsyncOpenReadOpenReadAsyncOpenTextOpenTextAsyncOpenWriteOpenWriteAsyncReadAllBytesReadAllBytesAsyncReadAllLinesReadAllLinesReadAllLinesAsyncReadAllLinesAsyncReadAllTextReadAllTextReadAllTextAsyncReadAllTextAsyncRetriveDateTimeInformationWriteAllBytesWriteAllBytesWriteAllBytesAsyncWriteAllBytesAsyncWriteAllLinesWriteAllLinesWriteAllLinesAsyncWriteAllLinesAsyncWriteAllTextWriteAllTextWriteAllTextAsyncWriteAllTextAsyncQuickIOFileInfoQuickIOFileInfoQuickIOFileInfoQuickIOFileInfoQuickIOFileInfoBytes { get; set; }Exists { get; }ExistsAsync { get; }Length { get; }public interfaceIQuickIOTransferObserverCancellationRequestedCompletedAddingRequestedDirectoryCreatedDirectoryCreatingDirectoryCreationErrorFileCopyErrorFileCopyFinishedFileCopyProgressFileCopyStartedFileCreationErrorFileCreationFinishedFileCreationProgressFileCreationStartedJobDequeuedJobEndJobEnqueuedJobErrorJobRequeuedJobRetryMaxReachedJobRunWorkerCreatedWorkerIsWaitingWorkerPickedJobWorkerShutdownWorkerStartedWorkerWokeUpOnCancellationRequestedOnCompletedAddingRequestedOnDirectoryCreatedOnDirectoryCreatingOnDirectoryCreationErrorOnFileCopyErrorOnFileCopyFinishedOnFileCopyProgressOnFileCopyStartedOnFileCreationErrorOnFileCreationFinishedOnFileCreationProgressOnFileCreationStartedOnJobDequeuedOnJobEndOnJobEnqueuedOnJobErrorOnJobRequeuedOnJobRetryMaxReachedOnJobRunOnWorkerCreatedOnWorkerIsWaitingOnWorkerPickedJobOnWorkerShutdownOnWorkerStartedOnWorkerWokeUp

save

reset

Drag to pan - Use Mousewheel + Ctrl to zoom