Skip to content
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

Update Storage to azure-core preview 3 #4489

Closed
Closed
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
10a85ad
Add storage swaggers
jianghaolu Jul 17, 2019
593ebf2
Update Storage to azure-core preview 3
jianghaolu Jul 19, 2019
b602214
Address code review feedback in AutoRest
jianghaolu Jul 24, 2019
9cbf411
Merge branch 'storage-post-review1-dev' of github.com:Azure/azure-sdk…
jianghaolu Jul 24, 2019
822b41d
Merge branch 'storage-post-review1-dev' of github.com:Azure/azure-sdk…
jianghaolu Jul 24, 2019
e19ea2b
Regenerate blob file queue after merge
jianghaolu Jul 24, 2019
7149824
Up azure core version for file & queue
jianghaolu Jul 24, 2019
efc335c
Apply all the manual fixes in swagger
jianghaolu Jul 24, 2019
87f3090
Change directoryName to directoryPath
jianghaolu Jul 24, 2019
5ce9473
Merge branch 'storage-post-review1-dev' of github.com:Azure/azure-sdk…
jianghaolu Jul 24, 2019
28beb79
Use non-fluent pattern for generated clients
jianghaolu Jul 24, 2019
570632c
Feature Work for Storage (#4584)
alzimmermsft Jul 25, 2019
ea2f43a
Removing the Jackson leak in HttpHeaders, instead registering a separ…
JonathanGiles Jul 26, 2019
9739dc6
Batch #2 - 11. No .builder() API: No classes should have a .builder()…
Jul 26, 2019
dd272bf
Add Tracing context in Key Vault keys package (#4500)
samvaity Jul 26, 2019
62c2dfc
Merge branch 'storage-post-review1-dev' of github.com:Azure/azure-sdk…
jianghaolu Jul 26, 2019
a5bc2dd
Merge branch 'master' of github.com:Azure/azure-sdk-for-java into sto…
jianghaolu Jul 26, 2019
a2b67ea
Fix build after merging with master
jianghaolu Jul 26, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions storage/client/blob/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core</artifactId>
<version>1.0.0-preview.2</version>
<version>1.0.0-preview.3</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
Expand All @@ -69,7 +69,7 @@
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core-test</artifactId>
<version>1.0.0-preview.2</version>
<version>1.0.0-preview.3</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public class BlobAsyncClient {
public BlockBlobAsyncClient asBlockBlobAsyncClient() {
return new BlockBlobAsyncClient(new AzureBlobStorageBuilder()
.url(getBlobUrl().toString())
.pipeline(azureBlobStorage.httpPipeline()), snapshot);
.pipeline(azureBlobStorage.getHttpPipeline()), snapshot);
}

/**
Expand All @@ -110,7 +110,7 @@ public BlockBlobAsyncClient asBlockBlobAsyncClient() {
public AppendBlobAsyncClient asAppendBlobAsyncClient() {
return new AppendBlobAsyncClient(new AzureBlobStorageBuilder()
.url(getBlobUrl().toString())
.pipeline(azureBlobStorage.httpPipeline()), snapshot);
.pipeline(azureBlobStorage.getHttpPipeline()), snapshot);
}

/**
Expand All @@ -122,7 +122,7 @@ public AppendBlobAsyncClient asAppendBlobAsyncClient() {
public PageBlobAsyncClient asPageBlobAsyncClient() {
return new PageBlobAsyncClient(new AzureBlobStorageBuilder()
.url(getBlobUrl().toString())
.pipeline(azureBlobStorage.httpPipeline()), snapshot);
.pipeline(azureBlobStorage.getHttpPipeline()), snapshot);
}

/**
Expand All @@ -136,7 +136,7 @@ public ContainerAsyncClient getContainerAsyncClient() {
BlobURLParts parts = URLParser.parse(getBlobUrl());
return new ContainerAsyncClient(new AzureBlobStorageBuilder()
.url(String.format("%s://%s/%s", parts.scheme(), parts.host(), parts.containerName()))
.pipeline(azureBlobStorage.httpPipeline()));
.pipeline(azureBlobStorage.getHttpPipeline()));
}

/**
Expand All @@ -147,13 +147,13 @@ public ContainerAsyncClient getContainerAsyncClient() {
*/
public URL getBlobUrl() {
try {
UrlBuilder urlBuilder = UrlBuilder.parse(azureBlobStorage.url());
UrlBuilder urlBuilder = UrlBuilder.parse(azureBlobStorage.getUrl());
if (snapshot != null) {
urlBuilder.query("snapshot=" + snapshot);
}
return urlBuilder.toURL();
} catch (MalformedURLException e) {
throw new RuntimeException(String.format("Invalid URL on %s: %s" + getClass().getSimpleName(), azureBlobStorage.url()), e);
throw new RuntimeException(String.format("Invalid URL on %s: %s" + getClass().getSimpleName(), azureBlobStorage.getUrl()), e);
}
}

Expand Down Expand Up @@ -925,7 +925,7 @@ public String generateSAS(String identifier, BlobSASPermission permissions, Offs
cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType);

SharedKeyCredential sharedKeyCredential =
Utility.getSharedKeyCredential(this.azureBlobStorage.httpPipeline());
Utility.getSharedKeyCredential(this.azureBlobStorage.getHttpPipeline());

Utility.assertNotNull("sharedKeyCredential", sharedKeyCredential);

Expand All @@ -944,7 +944,7 @@ ServiceSASSignatureValues configureServiceSASSignatureValues(ServiceSASSignature
String accountName) {

// Set canonical name
serviceSASSignatureValues.canonicalName(this.azureBlobStorage.url(), accountName);
serviceSASSignatureValues.canonicalName(this.azureBlobStorage.getUrl(), accountName);

// Set snapshotId
serviceSASSignatureValues.snapshotId(getSnapshotId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public BlockBlobAsyncClient getBlockBlobAsyncClient(String blobName) {
public BlockBlobAsyncClient getBlockBlobAsyncClient(String blobName, String snapshot) {
return new BlockBlobAsyncClient(new AzureBlobStorageBuilder()
.url(Utility.appendToURLPath(getContainerUrl(), blobName).toString())
.pipeline(azureBlobStorage.httpPipeline()), snapshot);
.pipeline(azureBlobStorage.getHttpPipeline()), snapshot);
}

/**
Expand Down Expand Up @@ -140,7 +140,7 @@ public PageBlobAsyncClient getPageBlobAsyncClient(String blobName) {
public PageBlobAsyncClient getPageBlobAsyncClient(String blobName, String snapshot) {
return new PageBlobAsyncClient(new AzureBlobStorageBuilder()
.url(Utility.appendToURLPath(getContainerUrl(), blobName).toString())
.pipeline(azureBlobStorage.httpPipeline()), snapshot);
.pipeline(azureBlobStorage.getHttpPipeline()), snapshot);
}

/**
Expand Down Expand Up @@ -173,7 +173,7 @@ public AppendBlobAsyncClient getAppendBlobAsyncClient(String blobName) {
public AppendBlobAsyncClient getAppendBlobAsyncClient(String blobName, String snapshot) {
return new AppendBlobAsyncClient(new AzureBlobStorageBuilder()
.url(Utility.appendToURLPath(getContainerUrl(), blobName).toString())
.pipeline(azureBlobStorage.httpPipeline()), snapshot);
.pipeline(azureBlobStorage.getHttpPipeline()), snapshot);
}

/**
Expand Down Expand Up @@ -202,7 +202,7 @@ public BlobAsyncClient getBlobAsyncClient(String blobName) {
public BlobAsyncClient getBlobAsyncClient(String blobName, String snapshot) {
return new BlobAsyncClient(new AzureBlobStorageBuilder()
.url(Utility.appendToURLPath(getContainerUrl(), blobName).toString())
.pipeline(azureBlobStorage.httpPipeline()), snapshot);
.pipeline(azureBlobStorage.getHttpPipeline()), snapshot);
}

/**
Expand All @@ -213,7 +213,7 @@ public BlobAsyncClient getBlobAsyncClient(String blobName, String snapshot) {
public StorageAsyncClient getStorageAsyncClient() {
return new StorageAsyncClient(new AzureBlobStorageBuilder()
.url(Utility.stripLastPathSegment(getContainerUrl()).toString())
.pipeline(azureBlobStorage.httpPipeline()));
.pipeline(azureBlobStorage.getHttpPipeline()));
}

/**
Expand All @@ -224,9 +224,9 @@ public StorageAsyncClient getStorageAsyncClient() {
*/
public URL getContainerUrl() {
try {
return new URL(azureBlobStorage.url());
return new URL(azureBlobStorage.getUrl());
} catch (MalformedURLException e) {
throw new RuntimeException(String.format("Invalid URL on %s: %s" + getClass().getSimpleName(), azureBlobStorage.url()), e);
throw new RuntimeException(String.format("Invalid URL on %s: %s" + getClass().getSimpleName(), azureBlobStorage.getUrl()), e);
}
}

Expand Down Expand Up @@ -681,7 +681,7 @@ private Flux<BlobItem> listBlobsHierarchyHelper(String delimiter, ListBlobsOptio
} else {
prefixes = Flux.empty();
}
Flux<BlobItem> result = blobs.concatWith(prefixes.map(prefix -> new BlobItem().name(prefix.name()).isPrefix(true)));
Flux<BlobItem> result = blobs.map(item -> item.isPrefix(false)).concatWith(prefixes.map(prefix -> new BlobItem().name(prefix.name()).isPrefix(true)));

if (response.value().nextMarker() != null) {
// Recursively add the continuation items to the observable.
Expand Down Expand Up @@ -1102,7 +1102,7 @@ public String generateSAS(String identifier, ContainerSASPermission permissions,
cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType);

SharedKeyCredential sharedKeyCredential =
Utility.getSharedKeyCredential(this.azureBlobStorage.httpPipeline());
Utility.getSharedKeyCredential(this.azureBlobStorage.getHttpPipeline());

Utility.assertNotNull("sharedKeyCredential", sharedKeyCredential);

Expand All @@ -1119,7 +1119,7 @@ public String generateSAS(String identifier, ContainerSASPermission permissions,
*/
private ServiceSASSignatureValues configureServiceSASSignatureValues(ServiceSASSignatureValues serviceSASSignatureValues, String accountName) {
// Set canonical name
serviceSASSignatureValues.canonicalName(this.azureBlobStorage.url(), accountName);
serviceSASSignatureValues.canonicalName(this.azureBlobStorage.getUrl(), accountName);

// Set snapshotId to null
serviceSASSignatureValues.snapshotId(null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public final class StorageAsyncClient {
public ContainerAsyncClient getContainerAsyncClient(String containerName) {
return new ContainerAsyncClient(new AzureBlobStorageBuilder()
.url(Utility.appendToURLPath(getAccountUrl(), containerName).toString())
.pipeline(azureBlobStorage.httpPipeline()));
.pipeline(azureBlobStorage.getHttpPipeline()));
}

/**
Expand Down Expand Up @@ -125,9 +125,9 @@ public Mono<VoidResponse> deleteContainer(String containerName) {
*/
public URL getAccountUrl() {
try {
return new URL(azureBlobStorage.url());
return new URL(azureBlobStorage.getUrl());
} catch (MalformedURLException e) {
throw new RuntimeException(String.format("Invalid URL on %s: %s" + getClass().getSimpleName(), azureBlobStorage.url()), e);
throw new RuntimeException(String.format("Invalid URL on %s: %s" + getClass().getSimpleName(), azureBlobStorage.getUrl()), e);
}
}

Expand Down Expand Up @@ -318,7 +318,7 @@ public String generateAccountSAS(AccountSASService accountSASService, AccountSAS
accountSASSignatureValues.ipRange(ipRange);
accountSASSignatureValues.protocol(sasProtocol);

SharedKeyCredential sharedKeyCredential = Utility.getSharedKeyCredential(this.azureBlobStorage.httpPipeline());
SharedKeyCredential sharedKeyCredential = Utility.getSharedKeyCredential(this.azureBlobStorage.getHttpPipeline());

SASQueryParameters sasQueryParameters = accountSASSignatureValues.generateSASQueryParameters(sharedKeyCredential);

Expand Down
Loading