Skip to content

Commit

Permalink
Implemented getUrl api
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderYW committed Oct 10, 2021
1 parent 544f841 commit 2c6371b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Drivers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ export class AzureStorageDriver implements AzureStorageDriverContract {
location: string,
options: BlobDownloadOptions | any = {}
): Promise<NodeJS.ReadableStream> {
return (await this.getBlockBlobClient(location).download(0, 0, options)).readableStreamBody
return (await this.getBlockBlobClient(location).download(0, 0, options)).readableStreamBody as NodeJS.ReadableStream
}

/**
Expand All @@ -209,4 +209,11 @@ export class AzureStorageDriver implements AzureStorageDriverContract {
throw CannotGetMetaDataException.invoke(location, 'signedUrl', error)
}
}

/**
* Returns URL to a given path
*/
public async getUrl(location: string): Promise<string> {
return unescape(this.getBlockBlobClient(location).url)
}
}

0 comments on commit 2c6371b

Please sign in to comment.