IFolderCreateFileAsync Method |
IT Hit User File System
Creates a new file in this folder in the remote storage.
Namespace:
ITHit.FileSystem
Assembly:
ITHit.FileSystem (in ITHit.FileSystem.dll) Version: 7.0.22158.0-Beta
SyntaxTask<byte[]> CreateFileAsync(
IFileMetadata fileMetadata,
Stream content = null,
IInSyncResultContext inSyncResultContext = null,
CancellationToken cancellationToken = null
)
Function CreateFileAsync (
fileMetadata As IFileMetadata,
Optional content As Stream = Nothing,
Optional inSyncResultContext As IInSyncResultContext = Nothing,
Optional cancellationToken As CancellationToken = Nothing
) As Task(Of Byte())
Task<array<unsigned char>^>^ CreateFileAsync(
IFileMetadata^ fileMetadata,
Stream^ content = nullptr,
IInSyncResultContext^ inSyncResultContext = nullptr,
CancellationToken cancellationToken = nullptr
)
abstract CreateFileAsync :
fileMetadata : IFileMetadata *
?content : Stream *
?inSyncResultContext : IInSyncResultContext *
?cancellationToken : CancellationToken
(* Defaults:
let _content = defaultArg content null
let _inSyncResultContext = defaultArg inSyncResultContext null
let _cancellationToken = defaultArg cancellationToken null
*)
-> Task<byte[]>
Parameters
- fileMetadata
- Type: ITHit.FileSystemIFileMetadata
Information about the new file. - content (Optional)
- Type: System.IOStream
New file content or null if the file content can not be obtained, for example if the file is blocked. - inSyncResultContext (Optional)
- Type: ITHit.FileSystemIInSyncResultContext
If the SetInSync property is set to true
the item is converted to a placeholder and is marked as in-sync. Otherwise the item
remains a regular folder. The SetInSync property is true by default.
- cancellationToken (Optional)
- Type: System.ThreadingCancellationToken
The token to monitor for cancellation requests.
Return Value
Type:
TaskByte
Remote storage item ID of a newly created file or null if the remote storage does not provide item ID. See
RemoteStorageItemId description for more details about the remote storage item ID.
Remarks
If this method completes without exceptions and the SetInSync property
of the inSyncResultContext parameter is set to true
the item is converted to a placeholder and is marked as in-sync.
Otherwise, the file is not converted to a placeholder and remains a regular file.
Setting the SetInSync property of the inSyncResultContext
parameter to false
has the same affect as throwing an exception inside this method.
See Also