C# Class CmisSync.Lib.FileTransmission.SimpleFileUploader

Simple file uploader. Takes a given stream and uploads it to the server. Resuming an Upload is not supported.
Inheritance: IFileUploader
Mostra file Open project: OpenDataSpace/CmisSync Class Usage Examples

Public Methods

Method Description
AppendFile ( IDocument remoteDocument, Stream localFileStream, Transmission transmission, HashAlgorithm hashAlg ) : IDocument

Appends the localFileStream to the remoteDocument.

Dispose ( ) : void

Releases all resource used by the CmisSync.Lib.FileTransmission.SimpleFileUploader object.

Call Dispose when you are finished using the CmisSync.Lib.FileTransmission.SimpleFileUploader. The Dispose method leaves the CmisSync.Lib.FileTransmission.SimpleFileUploader in an unusable state. After calling Dispose, you must release all references to the CmisSync.Lib.FileTransmission.SimpleFileUploader so the garbage collector can reclaim the memory that the CmisSync.Lib.FileTransmission.SimpleFileUploader was occupying.

UploadFile ( IDocument remoteDocument, Stream localFileStream, Transmission transmission, HashAlgorithm hashAlg, bool overwrite = true, UpdateChecksum update = null ) : IDocument

Uploads the localFileStream to remoteDocument.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Dispose(bool disposing) executes in two distinct scenarios. If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. If disposing equals false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed.

Method Details

AppendFile() public method

Appends the localFileStream to the remoteDocument.
If Upload fails
public AppendFile ( IDocument remoteDocument, Stream localFileStream, Transmission transmission, HashAlgorithm hashAlg ) : IDocument
remoteDocument IDocument /// Remote document where the local content should be appended to. ///
localFileStream Stream /// Local file stream. ///
transmission Transmission
hashAlg System.Security.Cryptography.HashAlgorithm /// Hash alg which should be used to calculate a checksum over the appended content. ///
return IDocument

Dispose() public method

Releases all resource used by the CmisSync.Lib.FileTransmission.SimpleFileUploader object.
Call Dispose when you are finished using the CmisSync.Lib.FileTransmission.SimpleFileUploader. The Dispose method leaves the CmisSync.Lib.FileTransmission.SimpleFileUploader in an unusable state. After calling Dispose, you must release all references to the CmisSync.Lib.FileTransmission.SimpleFileUploader so the garbage collector can reclaim the memory that the CmisSync.Lib.FileTransmission.SimpleFileUploader was occupying.
public Dispose ( ) : void
return void

Dispose() protected method

Dispose(bool disposing) executes in two distinct scenarios. If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. If disposing equals false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed.
protected Dispose ( bool disposing ) : void
disposing bool If set to true disposing.
return void

UploadFile() public method

Uploads the localFileStream to remoteDocument.
If upload fails
public UploadFile ( IDocument remoteDocument, Stream localFileStream, Transmission transmission, HashAlgorithm hashAlg, bool overwrite = true, UpdateChecksum update = null ) : IDocument
remoteDocument IDocument /// Remote document where the local content should be uploaded to. ///
localFileStream Stream /// Local file stream. ///
transmission Transmission /// Transmission status where the uploader should report its uploading status. ///
hashAlg System.Security.Cryptography.HashAlgorithm /// Hash alg which should be used to calculate a checksum over the uploaded content. ///
overwrite bool /// If true, the local content will overwrite the existing content. ///
update UpdateChecksum
return IDocument