Skip to content

Commit 145b1c7

Browse files
azfile: File download methods (#20670)
azfile download methods
1 parent cc1cee6 commit 145b1c7

21 files changed

+2622
-224
lines changed

sdk/storage/azfile/assets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"AssetsRepo": "Azure/azure-sdk-assets",
33
"AssetsRepoPrefixPath": "go",
44
"TagPrefix": "go/storage/azfile",
5-
"Tag": "go/storage/azfile_f16684c6c5"
5+
"Tag": "go/storage/azfile_f1e8c5b99b"
66
}

sdk/storage/azfile/directory/client.go

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,13 @@ import (
1212
"github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
1313
"github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
1414
"github.com/Azure/azure-sdk-for-go/sdk/storage/azfile/file"
15-
"github.com/Azure/azure-sdk-for-go/sdk/storage/azfile/fileerror"
1615
"github.com/Azure/azure-sdk-for-go/sdk/storage/azfile/internal/base"
1716
"github.com/Azure/azure-sdk-for-go/sdk/storage/azfile/internal/exported"
1817
"github.com/Azure/azure-sdk-for-go/sdk/storage/azfile/internal/generated"
1918
"github.com/Azure/azure-sdk-for-go/sdk/storage/azfile/internal/shared"
20-
"github.com/Azure/azure-sdk-for-go/sdk/storage/azfile/sas"
2119
"net/http"
2220
"net/url"
2321
"strings"
24-
"time"
2522
)
2623

2724
// ClientOptions contains the optional parameters when creating a Client.
@@ -209,34 +206,3 @@ func (d *Client) NewListFilesAndDirectoriesPager(options *ListFilesAndDirectorie
209206
},
210207
})
211208
}
212-
213-
// GetSASURL is a convenience method for generating a SAS token for the currently pointed at directory.
214-
// It can only be used if the credential supplied during creation was a SharedKeyCredential.
215-
func (d *Client) GetSASURL(permissions sas.FilePermissions, expiry time.Time, o *GetSASURLOptions) (string, error) {
216-
if d.sharedKey() == nil {
217-
return "", fileerror.MissingSharedKeyCredential
218-
}
219-
st := o.format()
220-
221-
urlParts, err := sas.ParseURL(d.URL())
222-
if err != nil {
223-
return "", err
224-
}
225-
226-
qps, err := sas.SignatureValues{
227-
Version: sas.Version,
228-
Protocol: sas.ProtocolHTTPS,
229-
ShareName: urlParts.ShareName,
230-
DirectoryOrFilePath: urlParts.DirectoryOrFilePath,
231-
Permissions: permissions.String(),
232-
StartTime: st,
233-
ExpiryTime: expiry.UTC(),
234-
}.SignWithSharedKey(d.sharedKey())
235-
if err != nil {
236-
return "", err
237-
}
238-
239-
endpoint := d.URL() + "?" + qps.Encode()
240-
241-
return endpoint, nil
242-
}

0 commit comments

Comments
 (0)