-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added support for file share reliable download #22504
Merged
Merged
Changes from 3 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
cf8cd77
Added support for file share reliable download
gapra-msft 042593c
Merge branch 'main' into storage/fileShareReliable
gapra-msft 684844d
try to resolve test issue
gapra-msft ec85a85
removed null check
gapra-msft e78e23c
removed null check
gapra-msft 8af9313
file share exception annotation working
gapra-msft 1a891f1
Changes for new swagger/autorest
gapra-msft 700b961
Revert "file share exception annotation working"
gapra-msft d2f4197
Merge branch 'main' into storage/fileShareReliable
gapra-msft 41c328b
undo share customization change
gapra-msft f664719
Merge branch 'storage/fileShareReliable' of github.com:gapra-msft/azu…
gapra-msft 341bd48
file tests
gapra-msft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
...shared/java/com/azure/storage/common/test/shared/policy/MockRetryRangeResponsePolicy.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
package com.azure.storage.common.test.shared.policy; | ||
|
||
import com.azure.core.http.HttpPipelineCallContext; | ||
import com.azure.core.http.HttpPipelineNextPolicy; | ||
import com.azure.core.http.HttpResponse; | ||
import com.azure.core.http.policy.HttpPipelinePolicy; | ||
import reactor.core.publisher.Flux; | ||
import reactor.core.publisher.Mono; | ||
|
||
import java.io.IOException; | ||
|
||
public class MockRetryRangeResponsePolicy implements HttpPipelinePolicy { | ||
|
||
private final String rangeMatch; | ||
|
||
public MockRetryRangeResponsePolicy(String rangeMatch) { | ||
this.rangeMatch = rangeMatch; | ||
} | ||
|
||
@Override | ||
public Mono<HttpResponse> process(HttpPipelineCallContext context, HttpPipelineNextPolicy next) { | ||
return next.process().flatMap(response -> { | ||
if (!response.getRequest().getHeaders().getValue("x-ms-range").equals(rangeMatch)) { | ||
return Mono.error(new IllegalArgumentException("The range header was not set correctly on retry.")); | ||
} else { | ||
// ETag can be a dummy value. It's not validated, but DownloadResponse requires one | ||
return Mono.just(new MockDownloadHttpResponse(response, 206, Flux.error(new IOException()))); | ||
} | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -191,6 +191,13 @@ public static ShareFileDownloadHeaders transformFileDownloadHeaders(HttpHeaders | |
} | ||
} | ||
|
||
public static String getETag(HttpHeaders headers) { | ||
if (headers == null) { | ||
return null; | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should we assume headers aren't null ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. that seems like a fair assumption. Will remove. |
||
return headers.getValue("ETag"); | ||
} | ||
|
||
public static ShareFileItemProperties transformFileProperty(FileProperty property) { | ||
if (property == null) { | ||
return null; | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we assume etag isn't null? What would be scenario it is null ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed