/
ShareFileClient.yml
1274 lines (1148 loc) · 46.3 KB
/
ShareFileClient.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
### YamlMime:TSType
name: ShareFileClient
uid: '@azure/storage-file-share.ShareFileClient'
package: '@azure/storage-file-share'
summary: A ShareFileClient represents a URL to an Azure Storage file.
fullName: ShareFileClient
remarks: ''
isDeprecated: false
type: class
constructors:
- name: >-
ShareFileClient(string, Credential_2 | TokenCredential,
ShareClientOptions)
uid: '@azure/storage-file-share.ShareFileClient.constructor'
package: '@azure/storage-file-share'
summary: Creates an instance of ShareFileClient.
remarks: ''
isDeprecated: false
syntax:
content: >-
new ShareFileClient(url: string, credential?: Credential_2 |
TokenCredential, options?: ShareClientOptions)
parameters:
- id: url
type: string
description: |-
A URL string pointing to Azure Storage file, such as
"https://myaccount.file.core.windows.net/myshare/mydirectory/file". You can
append a SAS if using AnonymousCredential, such as
"https://myaccount.file.core.windows.net/myshare/mydirectory/file?sasString".
This method accepts an encoded URL or non-encoded URL pointing to a file.
Encoded URL string will NOT be escaped twice, only special characters in URL path will be escaped.
However, if a file or directory name includes %, file or directory name must be encoded in the URL.
Such as a file named "myfile%", the URL should be "https://myaccount.file.core.windows.net/myshare/mydirectory/myfile%25".
- id: credential
type: >-
<xref uid="@azure/storage-file-share.Credential" /> | <xref
uid="@azure/core-auth.TokenCredential" />
description: >-
Such as AnonymousCredential, StorageSharedKeyCredential or
TokenCredential,
If not specified, AnonymousCredential is used.
- id: options
type: <xref uid="@azure/storage-file-share.ShareClientOptions" />
description: Optional. Options to configure the HTTP pipeline.
- name: ShareFileClient(string, Pipeline, ShareClientConfig)
uid: '@azure/storage-file-share.ShareFileClient.constructor_1'
package: '@azure/storage-file-share'
summary: Creates an instance of ShareFileClient.
remarks: ''
isDeprecated: false
syntax:
content: >-
new ShareFileClient(url: string, pipeline: Pipeline, options?:
ShareClientConfig)
parameters:
- id: url
type: string
description: |-
A URL string pointing to Azure Storage file, such as
"https://myaccount.file.core.windows.net/myshare/mydirectory/file". You can
append a SAS if using AnonymousCredential, such as
"https://myaccount.file.core.windows.net/myshare/mydirectory/file?sasString".
This method accepts an encoded URL or non-encoded URL pointing to a file.
Encoded URL string will NOT be escaped twice, only special characters in URL path will be escaped.
However, if a file or directory name includes %, file or directory name must be encoded in the URL.
Such as a file named "myfile%", the URL should be "https://myaccount.file.core.windows.net/myshare/mydirectory/myfile%25".
- id: pipeline
type: <xref uid="@azure/storage-file-share.Pipeline" />
description: |-
Call newPipeline() to create a default
pipeline, or provide a customized pipeline.
- id: options
type: <xref uid="@azure/storage-file-share.ShareClientConfig" />
description: ''
properties:
- name: name
uid: '@azure/storage-file-share.ShareFileClient.name'
package: '@azure/storage-file-share'
summary: The name of the file
fullName: name
remarks: ''
isDeprecated: false
syntax:
content: string name
return:
description: ''
type: string
- name: path
uid: '@azure/storage-file-share.ShareFileClient.path'
package: '@azure/storage-file-share'
summary: The full path of the file
fullName: path
remarks: ''
isDeprecated: false
syntax:
content: string path
return:
description: ''
type: string
- name: shareName
uid: '@azure/storage-file-share.ShareFileClient.shareName'
package: '@azure/storage-file-share'
summary: The share name corresponding to this file client
fullName: shareName
remarks: ''
isDeprecated: false
syntax:
content: string shareName
return:
description: ''
type: string
inheritedProperties:
- name: accountName
uid: '@azure/storage-file-share.ShareFileClient.accountName'
package: '@azure/storage-file-share'
summary: ''
fullName: accountName
remarks: ''
isDeprecated: false
syntax:
content: 'accountName: string'
return:
description: ''
type: string
inheritanceDescription: <b>Inherited From</b> StorageClient.accountName
- name: url
uid: '@azure/storage-file-share.ShareFileClient.url'
package: '@azure/storage-file-share'
summary: URL string value.
fullName: url
remarks: ''
isDeprecated: false
syntax:
content: 'url: string'
return:
description: ''
type: string
inheritanceDescription: <b>Inherited From</b> StorageClient.url
methods:
- name: abortCopyFromURL(string, FileAbortCopyFromURLOptions)
uid: '@azure/storage-file-share.ShareFileClient.abortCopyFromURL'
package: '@azure/storage-file-share'
summary: >-
Aborts a pending Copy File operation, and leaves a destination file with
zero length and full
metadata.
See
https://docs.microsoft.com/en-us/rest/api/storageservices/abort-copy-file
remarks: ''
isDeprecated: false
syntax:
content: >-
function abortCopyFromURL(copyId: string, options?:
FileAbortCopyFromURLOptions): Promise<FileAbortCopyResponse>
parameters:
- id: copyId
type: string
description: Id of the Copy File operation to abort.
- id: options
type: <xref uid="@azure/storage-file-share.FileAbortCopyFromURLOptions" />
description: Options to File Abort Copy From URL operation.
return:
description: ''
type: >-
Promise<<xref uid="@azure/storage-file-share.FileAbortCopyResponse"
/>>
- name: clearRange(number, number, FileClearRangeOptions)
uid: '@azure/storage-file-share.ShareFileClient.clearRange'
package: '@azure/storage-file-share'
summary: |-
Clears the specified range and
releases the space used in storage for that range.
remarks: ''
isDeprecated: false
syntax:
content: >-
function clearRange(offset: number, contentLength: number, options?:
FileClearRangeOptions): Promise<FileUploadRangeResponse>
parameters:
- id: offset
type: number
description: ''
- id: contentLength
type: number
description: ''
- id: options
type: <xref uid="@azure/storage-file-share.FileClearRangeOptions" />
description: Options to File Clear Range operation.
return:
description: ''
type: >-
Promise<<xref
uid="@azure/storage-file-share.FileUploadRangeResponse" />>
- name: create(number, FileCreateOptions)
uid: '@azure/storage-file-share.ShareFileClient.create'
package: '@azure/storage-file-share'
summary: >-
Creates a new file or replaces a file. Note it only initializes the file
with no content.
See https://docs.microsoft.com/en-us/rest/api/storageservices/create-file
remarks: ''
isDeprecated: false
syntax:
content: >-
function create(size: number, options?: FileCreateOptions):
Promise<FileCreateResponse>
parameters:
- id: size
type: number
description: Specifies the maximum size in bytes for the file, up to 4 TB.
- id: options
type: <xref uid="@azure/storage-file-share.FileCreateOptions" />
description: Options to File Create operation.
return:
description: |-
Response data for the File Create operation.
Example usage:
```js
const content = "Hello world!";
// Create the file
await fileClient.create(content.length);
console.log("Created file successfully!");
// Then upload data to the file
await fileClient.uploadRange(content, 0, content.length);
console.log("Updated file successfully!")
```
type: >-
Promise<<xref uid="@azure/storage-file-share.FileCreateResponse"
/>>
- name: delete(FileDeleteOptions)
uid: '@azure/storage-file-share.ShareFileClient.delete'
package: '@azure/storage-file-share'
summary: >-
Removes the file from the storage account.
When a file is successfully deleted, it is immediately removed from the
storage
account's index and is no longer accessible to clients. The file's data is
later
removed from the service during garbage collection.
Delete File will fail with status code 409 (Conflict) and error code
SharingViolation
if the file is open on an SMB client.
Delete File is not supported on a share snapshot, which is a read-only
copy of
a share. An attempt to perform this operation on a share snapshot will
fail with 400 (InvalidQueryParameterValue)
See https://docs.microsoft.com/en-us/rest/api/storageservices/delete-file2
remarks: ''
isDeprecated: false
syntax:
content: >-
function delete(options?: FileDeleteOptions):
Promise<FileDeleteResponse>
parameters:
- id: options
type: <xref uid="@azure/storage-file-share.FileDeleteOptions" />
description: Options to File Delete operation.
return:
description: Response data for the File Delete operation.
type: >-
Promise<<xref uid="@azure/storage-file-share.FileDeleteResponse"
/>>
- name: deleteIfExists(FileDeleteOptions)
uid: '@azure/storage-file-share.ShareFileClient.deleteIfExists'
package: '@azure/storage-file-share'
summary: >-
Removes the file from the storage account if it exists.
When a file is successfully deleted, it is immediately removed from the
storage
account's index and is no longer accessible to clients. The file's data is
later
removed from the service during garbage collection.
Delete File will fail with status code 409 (Conflict) and error code
SharingViolation
if the file is open on an SMB client.
Delete File is not supported on a share snapshot, which is a read-only
copy of
a share. An attempt to perform this operation on a share snapshot will
fail with 400 (InvalidQueryParameterValue)
See https://docs.microsoft.com/en-us/rest/api/storageservices/delete-file2
remarks: ''
isDeprecated: false
syntax:
content: >-
function deleteIfExists(options?: FileDeleteOptions):
Promise<FileDeleteIfExistsResponse>
parameters:
- id: options
type: <xref uid="@azure/storage-file-share.FileDeleteOptions" />
description: ''
return:
description: ''
type: >-
Promise<<xref
uid="@azure/storage-file-share.FileDeleteIfExistsResponse" />>
- name: download(number, number, FileDownloadOptions)
uid: '@azure/storage-file-share.ShareFileClient.download'
package: '@azure/storage-file-share'
summary: >-
Reads or downloads a file from the system, including its metadata and
properties.
* In Node.js, data returns in a Readable stream `readableStreamBody`
* In browsers, data returns in a promise `contentAsBlob`
See https://docs.microsoft.com/en-us/rest/api/storageservices/get-file
remarks: ''
isDeprecated: false
syntax:
content: >-
function download(offset?: number, count?: number, options?:
FileDownloadOptions): Promise<FileDownloadResponseModel>
parameters:
- id: offset
type: number
description: >-
From which position of the file to download, greater than or equal
to 0
- id: count
type: number
description: >-
How much data to be downloaded, greater than 0. Will download to the
end when undefined
- id: options
type: <xref uid="@azure/storage-file-share.FileDownloadOptions" />
description: Options to File Download operation.
return:
description: |-
Response data for the File Download operation.
Example usage (Node.js):
```js
// Download a file to a string
const downloadFileResponse = await fileClient.download();
console.log(
"Downloaded file content:",
(await streamToBuffer(downloadFileResponse.readableStreamBody)).toString()}
);
// A helper method used to read a Node.js readable stream into string
async function streamToBuffer(readableStream) {
return new Promise((resolve, reject) => {
const chunks = [];
readableStream.on("data", (data) => {
chunks.push(data instanceof Buffer ? data : Buffer.from(data));
});
readableStream.on("end", () => {
resolve(Buffer.concat(chunks));
});
readableStream.on("error", reject);
});
}
```
Example usage (browsers):
```js
// Download a file to a string
const downloadFileResponse = await fileClient.download(0);
console.log(
"Downloaded file content:",
await blobToString(await downloadFileResponse.blobBody)}
);
// A helper method used to convert a browser Blob into string.
export async function blobToString(blob: Blob): Promise<string> {
const fileReader = new FileReader();
return new Promise<string>((resolve, reject) => {
fileReader.onloadend = (ev: any) => {
resolve(ev.target!.result);
};
fileReader.onerror = reject;
fileReader.readAsText(blob);
});
}
```
type: >-
Promise<<xref
uid="@azure/storage-file-share.FileDownloadResponseModel" />>
- name: downloadToBuffer(Buffer, number, number, FileDownloadToBufferOptions)
uid: '@azure/storage-file-share.ShareFileClient.downloadToBuffer'
package: '@azure/storage-file-share'
summary: >-
ONLY AVAILABLE IN NODE.JS RUNTIME.
Downloads an Azure file in parallel to a buffer.
Offset and count are optional, pass 0 for both to download the entire
file.
Warning: Buffers can only support files up to about one gigabyte on 32-bit
systems or about two
gigabytes on 64-bit systems due to limitations of Node.js/V8. For files
larger than this size,
consider
[downloadToFile](xref:@azure/storage-file-share.ShareFileClient.downloadToFile).
remarks: ''
isDeprecated: false
syntax:
content: >-
function downloadToBuffer(buffer: Buffer, offset?: number, count?:
number, options?: FileDownloadToBufferOptions): Promise<Buffer>
parameters:
- id: buffer
type: Buffer
description: Buffer to be fill, must have length larger than count
- id: offset
type: number
description: From which position of the Azure File to download
- id: count
type: number
description: >-
How much data to be downloaded. Will download to the end when
passing undefined
- id: options
type: <xref uid="@azure/storage-file-share.FileDownloadToBufferOptions" />
description: ''
return:
description: ''
type: Promise<Buffer>
- name: downloadToBuffer(number, number, FileDownloadToBufferOptions)
uid: '@azure/storage-file-share.ShareFileClient.downloadToBuffer_1'
package: '@azure/storage-file-share'
summary: >-
ONLY AVAILABLE IN NODE.JS RUNTIME
Downloads an Azure file in parallel to a buffer.
Offset and count are optional, pass 0 for both to download the entire file
Warning: Buffers can only support files up to about one gigabyte on 32-bit
systems or about two
gigabytes on 64-bit systems due to limitations of Node.js/V8. For files
larger than this size,
consider
[downloadToFile](xref:@azure/storage-file-share.ShareFileClient.downloadToFile).
remarks: ''
isDeprecated: false
syntax:
content: >-
function downloadToBuffer(offset?: number, count?: number, options?:
FileDownloadToBufferOptions): Promise<Buffer>
parameters:
- id: offset
type: number
description: From which position of the Azure file to download
- id: count
type: number
description: >-
How much data to be downloaded. Will download to the end when
passing undefined
- id: options
type: <xref uid="@azure/storage-file-share.FileDownloadToBufferOptions" />
description: ''
return:
description: ''
type: Promise<Buffer>
- name: downloadToFile(string, number, number, FileDownloadOptions)
uid: '@azure/storage-file-share.ShareFileClient.downloadToFile'
package: '@azure/storage-file-share'
summary: >-
ONLY AVAILABLE IN NODE.JS RUNTIME.
Downloads an Azure Blob to a local file.
Fails if the the given file path already exits.
Offset and count are optional, pass 0 and undefined respectively to
download the entire blob.
remarks: ''
isDeprecated: false
syntax:
content: >-
function downloadToFile(filePath: string, offset?: number, count?:
number, options?: FileDownloadOptions):
Promise<FileDownloadResponseModel>
parameters:
- id: filePath
type: string
description: ''
- id: offset
type: number
description: From which position of the block blob to download.
- id: count
type: number
description: >-
How much data to be downloaded. Will download to the end when
passing undefined.
- id: options
type: <xref uid="@azure/storage-file-share.FileDownloadOptions" />
description: Options to Blob download options.
return:
description: |-
The response data for blob download operation,
but with readableStreamBody set to undefined since its
content is already read and written into a local file
at the specified path.
type: >-
Promise<<xref
uid="@azure/storage-file-share.FileDownloadResponseModel" />>
- name: exists(FileExistsOptions)
uid: '@azure/storage-file-share.ShareFileClient.exists'
package: '@azure/storage-file-share'
summary: >-
Returns true if the specified file exists; false otherwise.
NOTE: use this function with care since an existing file might be deleted
by other clients or
applications. Vice versa new files might be added by other clients or
applications after this
function completes.
remarks: ''
isDeprecated: false
syntax:
content: 'function exists(options?: FileExistsOptions): Promise<boolean>'
parameters:
- id: options
type: <xref uid="@azure/storage-file-share.FileExistsOptions" />
description: options to Exists operation.
return:
description: ''
type: Promise<boolean>
- name: forceCloseAllHandles(FileForceCloseHandlesOptions)
uid: '@azure/storage-file-share.ShareFileClient.forceCloseAllHandles'
package: '@azure/storage-file-share'
summary: >-
Force close all handles for a file.
See
https://docs.microsoft.com/en-us/rest/api/storageservices/force-close-handles
remarks: ''
isDeprecated: false
syntax:
content: >-
function forceCloseAllHandles(options?: FileForceCloseHandlesOptions):
Promise<CloseHandlesInfo>
parameters:
- id: options
type: >-
<xref uid="@azure/storage-file-share.FileForceCloseHandlesOptions"
/>
description: Options to force close handles operation.
return:
description: ''
type: >-
Promise<<xref uid="@azure/storage-file-share.CloseHandlesInfo"
/>>
- name: forceCloseHandle(string, FileForceCloseHandlesOptions)
uid: '@azure/storage-file-share.ShareFileClient.forceCloseHandle'
package: '@azure/storage-file-share'
summary: >-
Force close a specific handle for a file.
See
https://docs.microsoft.com/en-us/rest/api/storageservices/force-close-handles
remarks: ''
isDeprecated: false
syntax:
content: >-
function forceCloseHandle(handleId: string, options?:
FileForceCloseHandlesOptions): Promise<FileForceCloseHandlesResponse>
parameters:
- id: handleId
type: string
description: |-
Specific handle ID, cannot be asterisk "*".
Use forceCloseAllHandles() to close all handles.
- id: options
type: >-
<xref uid="@azure/storage-file-share.FileForceCloseHandlesOptions"
/>
description: ''
return:
description: ''
type: >-
Promise<<xref
uid="@azure/storage-file-share.FileForceCloseHandlesResponse" />>
- name: generateSasUrl(FileGenerateSasUrlOptions)
uid: '@azure/storage-file-share.ShareFileClient.generateSasUrl'
package: '@azure/storage-file-share'
summary: >-
Only available for clients constructed with a shared key credential.
Generates a Service Shared Access Signature (SAS) URI based on the client
properties
and parameters passed in. The SAS is signed by the shared key credential
of the client.
See
https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas
remarks: ''
isDeprecated: false
syntax:
content: 'function generateSasUrl(options: FileGenerateSasUrlOptions): string'
parameters:
- id: options
type: <xref uid="@azure/storage-file-share.FileGenerateSasUrlOptions" />
description: Optional parameters.
return:
description: >-
The SAS URI consisting of the URI to the resource represented by this
client, followed by the generated SAS token.
type: string
- name: getProperties(FileGetPropertiesOptions)
uid: '@azure/storage-file-share.ShareFileClient.getProperties'
package: '@azure/storage-file-share'
summary: >-
Returns all user-defined metadata, standard HTTP properties, and system
properties
for the file. It does not return the content of the file.
See
https://docs.microsoft.com/en-us/rest/api/storageservices/get-file-properties
remarks: ''
isDeprecated: false
syntax:
content: >-
function getProperties(options?: FileGetPropertiesOptions):
Promise<FileGetPropertiesResponse>
parameters:
- id: options
type: <xref uid="@azure/storage-file-share.FileGetPropertiesOptions" />
description: Options to File Get Properties operation.
return:
description: Response data for the File Get Properties operation.
type: >-
Promise<<xref
uid="@azure/storage-file-share.FileGetPropertiesResponse" />>
- name: getRangeList(FileGetRangeListOptions)
uid: '@azure/storage-file-share.ShareFileClient.getRangeList'
package: '@azure/storage-file-share'
summary: Returns the list of valid ranges for a file.
remarks: ''
isDeprecated: false
syntax:
content: >-
function getRangeList(options?: FileGetRangeListOptions):
Promise<FileGetRangeListResponse>
parameters:
- id: options
type: <xref uid="@azure/storage-file-share.FileGetRangeListOptions" />
description: Options to File Get range List operation.
return:
description: ''
type: >-
Promise<<xref
uid="@azure/storage-file-share.FileGetRangeListResponse" />>
- name: getRangeListDiff(string, FileGetRangeListOptions)
uid: '@azure/storage-file-share.ShareFileClient.getRangeListDiff'
package: '@azure/storage-file-share'
summary: >-
Returns the list of ranges that differ between a previous share snapshot
and this file.
remarks: ''
isDeprecated: false
syntax:
content: >-
function getRangeListDiff(prevShareSnapshot: string, options?:
FileGetRangeListOptions): Promise<FileGetRangeListDiffResponse>
parameters:
- id: prevShareSnapshot
type: string
description: >-
The previous snapshot parameter is an opaque DateTime value that
specifies the previous share snapshot to compare with.
- id: options
type: <xref uid="@azure/storage-file-share.FileGetRangeListOptions" />
description: ''
return:
description: ''
type: >-
Promise<<xref
uid="@azure/storage-file-share.FileGetRangeListDiffResponse" />>
- name: getShareLeaseClient(string)
uid: '@azure/storage-file-share.ShareFileClient.getShareLeaseClient'
package: '@azure/storage-file-share'
summary: >-
Get a [ShareLeaseClient](xref:@azure/storage-file-share.ShareLeaseClient)
that manages leases on the file.
remarks: ''
isDeprecated: false
syntax:
content: 'function getShareLeaseClient(proposeLeaseId?: string): ShareLeaseClient'
parameters:
- id: proposeLeaseId
type: string
description: Initial proposed lease Id.
return:
description: A new ShareLeaseClient object for managing leases on the file.
type: <xref uid="@azure/storage-file-share.ShareLeaseClient" />
- name: listHandles(FileListHandlesOptions)
uid: '@azure/storage-file-share.ShareFileClient.listHandles'
package: '@azure/storage-file-share'
summary: |-
Returns an async iterable iterator to list all the handles.
under the specified account.
.byPage() returns an async iterable iterator to list the handles in pages.
remarks: ''
isDeprecated: false
syntax:
content: >-
function listHandles(options?: FileListHandlesOptions):
PagedAsyncIterableIterator<HandleItem, FileListHandlesResponse,
PageSettings>
parameters:
- id: options
type: <xref uid="@azure/storage-file-share.FileListHandlesOptions" />
description: |-
Options to list handles operation.
An asyncIterableIterator that supports paging.
return:
description: ''
type: >-
<xref uid="@azure/core-paging.PagedAsyncIterableIterator" /><<xref
uid="@azure/storage-file-share.HandleItem" />, <xref
uid="@azure/storage-file-share.FileListHandlesResponse" />, <xref
uid="@azure/core-paging.PageSettings" />>
- name: rename(string, FileRenameOptions)
uid: '@azure/storage-file-share.ShareFileClient.rename'
package: '@azure/storage-file-share'
summary: |-
Renames a file.
This API only supports renaming a file in the same share.
remarks: ''
isDeprecated: false
syntax:
content: >-
function rename(destinationPath: string, options?: FileRenameOptions):
Promise<{ destinationFileClient: ShareFileClient, fileRenameResponse:
FileRenameResponse }>
parameters:
- id: destinationPath
type: string
description: >-
Specifies the destination path to rename to. The path will be
encoded to put into a URL to specify the destination.
- id: options
type: <xref uid="@azure/storage-file-share.FileRenameOptions" />
description: Options for the renaming operation.
return:
description: |-
Response data for the file renaming operation.
Example usage:
```js
// Rename the file
await fileClient.rename(destinationPath);
console.log("Renamed file successfully!");
```
type: >-
Promise<{ destinationFileClient: ShareFileClient,
fileRenameResponse: FileRenameResponse }>
- name: resize(number, FileResizeOptions)
uid: '@azure/storage-file-share.ShareFileClient.resize'
package: '@azure/storage-file-share'
summary: >-
Resize file.
See
https://docs.microsoft.com/en-us/rest/api/storageservices/set-file-properties
remarks: ''
isDeprecated: false
syntax:
content: >-
function resize(length: number, options?: FileResizeOptions):
Promise<FileSetHTTPHeadersResponse>
parameters:
- id: length
type: number
description: |-
Resizes a file to the specified size in bytes.
If the specified byte value is less than the current size of the file,
then all ranges above the specified byte value are cleared.
- id: options
type: <xref uid="@azure/storage-file-share.FileResizeOptions" />
description: Options to File Resize operation.
return:
description: Response data for the File Set HTTP Headers operation.
type: >-
Promise<<xref
uid="@azure/storage-file-share.FileSetHTTPHeadersResponse" />>
- name: setHttpHeaders(FileHttpHeaders, FileSetHttpHeadersOptions)
uid: '@azure/storage-file-share.ShareFileClient.setHttpHeaders'
package: '@azure/storage-file-share'
summary: >-
Sets HTTP headers on the file.
If no option provided, or no value provided for the file HTTP headers in
the options,
these file HTTP headers without a value will be cleared.
See
https://docs.microsoft.com/en-us/rest/api/storageservices/set-file-properties
remarks: ''
isDeprecated: false
syntax:
content: >-
function setHttpHeaders(fileHttpHeaders?: FileHttpHeaders, options?:
FileSetHttpHeadersOptions): Promise<FileSetHTTPHeadersResponse>
parameters:
- id: fileHttpHeaders
type: <xref uid="@azure/storage-file-share.FileHttpHeaders" />
description: ''
- id: options
type: <xref uid="@azure/storage-file-share.FileSetHttpHeadersOptions" />
description: Options to File Set HTTP Headers operation.
return:
description: Response data for the File Set HTTP Headers operation.
type: >-
Promise<<xref
uid="@azure/storage-file-share.FileSetHTTPHeadersResponse" />>
- name: setMetadata(Metadata, FileSetMetadataOptions)
uid: '@azure/storage-file-share.ShareFileClient.setMetadata'
package: '@azure/storage-file-share'
summary: >-
Updates user-defined metadata for the specified file.
If no metadata defined in the option parameter, the file
metadata will be removed.
See
https://docs.microsoft.com/en-us/rest/api/storageservices/set-file-metadata
remarks: ''
isDeprecated: false
syntax:
content: >-
function setMetadata(metadata?: Metadata, options?:
FileSetMetadataOptions): Promise<FileSetMetadataResponse>
parameters:
- id: metadata
type: <xref uid="@azure/storage-file-share.Metadata" />
description: >-
If no metadata provided, all existing directory metadata will be
removed
- id: options
type: <xref uid="@azure/storage-file-share.FileSetMetadataOptions" />
description: Options to File Set Metadata operation.
return:
description: Response data for the File Set Metadata operation.
type: >-
Promise<<xref
uid="@azure/storage-file-share.FileSetMetadataResponse" />>
- name: setProperties(FileProperties)
uid: '@azure/storage-file-share.ShareFileClient.setProperties'
package: '@azure/storage-file-share'
summary: >-
Sets properties on the file.
See
https://docs.microsoft.com/en-us/rest/api/storageservices/set-file-properties
remarks: ''
isDeprecated: false
syntax:
content: >-
function setProperties(properties?: FileProperties):
Promise<SetPropertiesResponse>
parameters:
- id: properties
type: <xref uid="@azure/storage-file-share.FileProperties" />
description: |-
File properties. For file HTTP headers(e.g. Content-Type),
if no values are provided, existing HTTP headers will be removed.
For other file properties(e.g. fileAttributes), if no values are provided,
existing values will be preserved.
return:
description: ''
type: >-
Promise<<xref uid="@azure/storage-file-share.SetPropertiesResponse"
/>>
- name: startCopyFromURL(string, FileStartCopyOptions)
uid: '@azure/storage-file-share.ShareFileClient.startCopyFromURL'
package: '@azure/storage-file-share'
summary: Copies a blob or file to a destination file within the storage account.
remarks: ''
isDeprecated: false
syntax:
content: >-
function startCopyFromURL(copySource: string, options?:
FileStartCopyOptions): Promise<FileStartCopyResponse>
parameters:
- id: copySource
type: string
description: >-
Specifies the URL of the source file or blob, up to 2 KB in length.
To copy a file to another file within the same storage account, you
may use Shared Key to
authenticate the source file. If you are copying a file from another
storage account, or if you
are copying a blob from the same storage account or another storage
account, then you must
authenticate the source file or blob using a shared access
signature. If the source is a public
blob, no authentication is required to perform the copy operation. A
file in a share snapshot
can also be specified as a copy source.
- id: options
type: <xref uid="@azure/storage-file-share.FileStartCopyOptions" />
description: Options to File Start Copy operation.
return:
description: ''
type: >-
Promise<<xref uid="@azure/storage-file-share.FileStartCopyResponse"
/>>
- name: >-
uploadData(Blob | ArrayBuffer | ArrayBufferView | Buffer,
FileParallelUploadOptions)
uid: '@azure/storage-file-share.ShareFileClient.uploadData'
package: '@azure/storage-file-share'
summary: >-
Creates a new Azure File or replaces an existing Azure File, and then
uploads a Buffer(Node)/Blob/ArrayBuffer/ArrayBufferView to it.
remarks: ''
isDeprecated: false
syntax:
content: >-
function uploadData(data: Blob | ArrayBuffer | ArrayBufferView | Buffer,
options?: FileParallelUploadOptions): Promise<void>
parameters:
- id: data
type: Blob | ArrayBuffer | ArrayBufferView | Buffer
description: Buffer(Node), Blob, ArrayBuffer or ArrayBufferView
- id: options
type: <xref uid="@azure/storage-file-share.FileParallelUploadOptions" />
description: ''
return:
description: ''
type: Promise<void>