@@ -25,7 +25,7 @@ public class ShareFilesStorageResourceProvider : StorageResourceProvider
2525 /// <param name="readOnly">
2626 /// Whether the permission can be read-only.
2727 /// </param>
28- public delegate StorageSharedKeyCredential GetStorageSharedKeyCredential ( string uri , bool readOnly ) ;
28+ public delegate StorageSharedKeyCredential GetStorageSharedKeyCredential ( Uri uri , bool readOnly ) ;
2929
3030 /// <summary>
3131 /// Delegate for fetching a token credential for a given URI.
@@ -36,7 +36,7 @@ public class ShareFilesStorageResourceProvider : StorageResourceProvider
3636 /// <param name="readOnly">
3737 /// Whether the permission can be read-only.
3838 /// </param>
39- public delegate TokenCredential GetTokenCredential ( string uri , bool readOnly ) ;
39+ public delegate TokenCredential GetTokenCredential ( Uri uri , bool readOnly ) ;
4040
4141 /// <summary>
4242 /// Delegate for fetching a SAS credential for a given URI.
@@ -47,7 +47,7 @@ public class ShareFilesStorageResourceProvider : StorageResourceProvider
4747 /// <param name="readOnly">
4848 /// Whether the permission can be read-only.
4949 /// </param>
50- public delegate AzureSasCredential GetAzureSasCredential ( string uri , bool readOnly ) ;
50+ public delegate AzureSasCredential GetAzureSasCredential ( Uri uri , bool readOnly ) ;
5151
5252 private enum ResourceType
5353 {
@@ -229,8 +229,8 @@ protected override Task<StorageResource> FromSourceAsync(DataTransferProperties
229229 // Source share file data currently empty, so no specific properties to grab
230230
231231 return Task . FromResult ( properties . IsContainer
232- ? FromDirectory ( properties . SourceUri . AbsoluteUri )
233- : FromFile ( properties . SourceUri . AbsoluteUri ) ) ;
232+ ? FromDirectory ( properties . SourceUri )
233+ : FromFile ( properties . SourceUri ) ) ;
234234 }
235235
236236 /// <inheritdoc/>
@@ -258,8 +258,8 @@ protected override Task<StorageResource> FromDestinationAsync(DataTransferProper
258258 FileMetadata = checkpointData . FileMetadata ,
259259 } ;
260260 return Task . FromResult ( properties . IsContainer
261- ? FromDirectory ( properties . DestinationUri . AbsoluteUri , options )
262- : FromFile ( properties . DestinationUri . AbsoluteUri , options ) ) ;
261+ ? FromDirectory ( properties . DestinationUri , options )
262+ : FromFile ( properties . DestinationUri , options ) ) ;
263263 }
264264
265265 /// <summary>
@@ -294,14 +294,14 @@ internal async Task<StorageResource> FromDestinationInternalHookAsync(
294294 /// <returns>
295295 /// The configured storage resource.
296296 /// </returns>
297- public StorageResource FromDirectory ( string directoryUri , ShareFileStorageResourceOptions options = default )
297+ public StorageResource FromDirectory ( Uri directoryUri , ShareFileStorageResourceOptions options = default )
298298 {
299299 ShareDirectoryClient client = _credentialType switch
300300 {
301- CredentialType . None => new ShareDirectoryClient ( new Uri ( directoryUri ) ) ,
302- CredentialType . SharedKey => new ShareDirectoryClient ( new Uri ( directoryUri ) , _getStorageSharedKeyCredential ( directoryUri , false ) ) ,
303- CredentialType . Token => new ShareDirectoryClient ( new Uri ( directoryUri ) , _getTokenCredential ( directoryUri , false ) ) ,
304- CredentialType . Sas => new ShareDirectoryClient ( new Uri ( directoryUri ) , _getAzureSasCredential ( directoryUri , false ) ) ,
301+ CredentialType . None => new ShareDirectoryClient ( directoryUri ) ,
302+ CredentialType . SharedKey => new ShareDirectoryClient ( directoryUri , _getStorageSharedKeyCredential ( directoryUri , false ) ) ,
303+ CredentialType . Token => new ShareDirectoryClient ( directoryUri , _getTokenCredential ( directoryUri , false ) ) ,
304+ CredentialType . Sas => new ShareDirectoryClient ( directoryUri , _getAzureSasCredential ( directoryUri , false ) ) ,
305305 _ => throw BadCredentialTypeException ( _credentialType ) ,
306306 } ;
307307 return new ShareDirectoryStorageResourceContainer ( client , options ) ;
@@ -320,15 +320,15 @@ public StorageResource FromDirectory(string directoryUri, ShareFileStorageResour
320320 /// The configured storage resource.
321321 /// </returns>
322322 public StorageResource FromFile (
323- string fileUri ,
323+ Uri fileUri ,
324324 ShareFileStorageResourceOptions options = default )
325325 {
326326 ShareFileClient client = _credentialType switch
327327 {
328- CredentialType . None => new ShareFileClient ( new Uri ( fileUri ) ) ,
329- CredentialType . SharedKey => new ShareFileClient ( new Uri ( fileUri ) , _getStorageSharedKeyCredential ( fileUri , false ) ) ,
330- CredentialType . Token => new ShareFileClient ( new Uri ( fileUri ) , _getTokenCredential ( fileUri , false ) ) ,
331- CredentialType . Sas => new ShareFileClient ( new Uri ( fileUri ) , _getAzureSasCredential ( fileUri , false ) ) ,
328+ CredentialType . None => new ShareFileClient ( fileUri ) ,
329+ CredentialType . SharedKey => new ShareFileClient ( fileUri , _getStorageSharedKeyCredential ( fileUri , false ) ) ,
330+ CredentialType . Token => new ShareFileClient ( fileUri , _getTokenCredential ( fileUri , false ) ) ,
331+ CredentialType . Sas => new ShareFileClient ( fileUri , _getAzureSasCredential ( fileUri , false ) ) ,
332332 _ => throw BadCredentialTypeException ( _credentialType ) ,
333333 } ;
334334 return new ShareFileStorageResource ( client , options ) ;
0 commit comments