Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@
<Or>
<Package name="com.microsoft.azure.storage.blob"/>
<Package name="com.azure.storage.file.models"/>
<Class name="com.azure.storage.blob.HTTPGetterInfo"/>
<Class name="com.azure.storage.blob.HttpGetterInfo"/>
<Class name="com.azure.storage.blob.BlobProperties"/>
<Class name="com.azure.storage.blob.BlobContainerProperties"/>
<Class name="com.azure.storage.file.implementation.models.DirectoryCreateHeaders"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import com.azure.messaging.eventhubs.models.PartitionOwnership;
import com.azure.storage.blob.BlobContainerAsyncClient;
import com.azure.storage.blob.BlobContainerClientBuilder;

import java.util.StringJoiner;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@
import com.azure.messaging.eventhubs.models.PartitionContext;
import com.azure.storage.blob.BlobContainerAsyncClient;
import com.azure.storage.blob.BlobContainerClientBuilder;
import reactor.core.publisher.Mono;

import java.util.concurrent.TimeUnit;
import reactor.core.publisher.Mono;

/**
* Sample for using {@link BlobPartitionManager} with {@link EventProcessor}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public BlobAsyncClient buildAsyncClient() {
public BlobClientBuilder endpoint(String endpoint) {
try {
URL url = new URL(endpoint);
BlobURLParts parts = BlobURLParts.parse(url);
BlobUrlParts parts = BlobUrlParts.parse(url);

this.endpoint = parts.getScheme() + "://" + parts.getHost();
this.containerName = parts.getBlobContainerName();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

package com.azure.storage.blob;

import static com.azure.core.implementation.util.FluxUtil.withContext;
import static com.azure.storage.blob.implementation.PostProcessor.postProcessResponse;

import com.azure.core.annotation.ServiceClient;
import com.azure.core.http.HttpPipeline;
import com.azure.core.http.HttpResponse;
Expand All @@ -18,9 +21,9 @@
import com.azure.storage.blob.implementation.AzureBlobStorageImpl;
import com.azure.storage.blob.implementation.models.ContainersListBlobFlatSegmentResponse;
import com.azure.storage.blob.implementation.models.ContainersListBlobHierarchySegmentResponse;
import com.azure.storage.blob.models.BlobContainerAccessConditions;
import com.azure.storage.blob.models.BlobContainerAccessPolicies;
import com.azure.storage.blob.models.BlobItem;
import com.azure.storage.blob.models.BlobContainerAccessConditions;
import com.azure.storage.blob.models.CpkInfo;
import com.azure.storage.blob.models.LeaseAccessConditions;
import com.azure.storage.blob.models.ListBlobsOptions;
Expand All @@ -30,8 +33,6 @@
import com.azure.storage.blob.models.StorageAccountInfo;
import com.azure.storage.blob.models.StorageException;
import com.azure.storage.common.Utility;
import reactor.core.publisher.Mono;

import java.time.Duration;
import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
Expand All @@ -40,9 +41,7 @@
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import static com.azure.core.implementation.util.FluxUtil.withContext;
import static com.azure.storage.blob.implementation.PostProcessor.postProcessResponse;
import reactor.core.publisher.Mono;

/**
* Client to a container. It may only be instantiated through a {@link BlobContainerClientBuilder} or via the method
Expand Down Expand Up @@ -143,7 +142,7 @@ public String getBlobContainerUrl() {
* @return The name of container.
*/
public String getBlobContainerName() {
return BlobURLParts.parse(this.azureBlobStorage.getUrl(), logger).getBlobContainerName();
return BlobUrlParts.parse(this.azureBlobStorage.getUrl(), logger).getBlobContainerName();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@
import com.azure.storage.blob.models.SignedIdentifier;
import com.azure.storage.blob.models.StorageAccountInfo;
import com.azure.storage.common.Utility;
import reactor.core.publisher.Mono;

import java.time.Duration;
import java.util.List;
import java.util.Map;
import reactor.core.publisher.Mono;

/**
* Client to a container. It may only be instantiated through a {@link BlobContainerClientBuilder} or via the method
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import com.azure.core.implementation.util.ImplUtils;
import com.azure.core.util.logging.ClientLogger;
import com.azure.storage.blob.implementation.AzureBlobStorageBuilder;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.Objects;
Expand Down Expand Up @@ -93,7 +92,7 @@ public BlobContainerAsyncClient buildAsyncClient() {
public BlobContainerClientBuilder endpoint(String endpoint) {
try {
URL url = new URL(endpoint);
BlobURLParts parts = BlobURLParts.parse(url);
BlobUrlParts parts = BlobUrlParts.parse(url);

this.endpoint = parts.getScheme() + "://" + parts.getHost();
this.containerName = parts.getBlobContainerName();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

package com.azure.storage.blob;

import static com.azure.core.implementation.util.FluxUtil.withContext;
import static com.azure.storage.blob.implementation.PostProcessor.postProcessResponse;

import com.azure.core.annotation.ServiceClient;
import com.azure.core.credentials.TokenCredential;
import com.azure.core.http.HttpPipeline;
Expand All @@ -27,15 +30,11 @@
import com.azure.storage.blob.models.StorageServiceStats;
import com.azure.storage.blob.models.UserDelegationKey;
import com.azure.storage.common.Utility;
import reactor.core.publisher.Mono;

import java.time.Duration;
import java.time.OffsetDateTime;
import java.util.Map;
import java.util.function.Function;

import static com.azure.core.implementation.util.FluxUtil.withContext;
import static com.azure.storage.blob.implementation.PostProcessor.postProcessResponse;
import reactor.core.publisher.Mono;

/**
* Client to a storage account. It may only be instantiated through a {@link BlobServiceClientBuilder}. This class does
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@
import com.azure.storage.blob.models.StorageServiceStats;
import com.azure.storage.blob.models.UserDelegationKey;
import com.azure.storage.common.Utility;
import reactor.core.publisher.Mono;

import java.time.Duration;
import java.time.OffsetDateTime;
import java.util.Map;
import reactor.core.publisher.Mono;

/**
* Client to a storage account. It may only be instantiated through a {@link BlobServiceClientBuilder}. This class does
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import com.azure.core.implementation.util.ImplUtils;
import com.azure.core.util.logging.ClientLogger;
import com.azure.storage.blob.implementation.AzureBlobStorageBuilder;

import java.net.MalformedURLException;
import java.net.URL;

Expand Down Expand Up @@ -76,7 +75,7 @@ public BlobServiceClientBuilder endpoint(String endpoint) {
URL url = new URL(endpoint);
super.endpoint = url.getProtocol() + "://" + url.getAuthority();

String sasToken = BlobURLParts.parse(url).getSasQueryParameters().encode();
String sasToken = BlobUrlParts.parse(url).getSasQueryParameters().encode();
if (!ImplUtils.isNullOrEmpty(sasToken)) {
super.sasToken(sasToken);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* existing URL into its parts with the {@link #parse(URL)} class. You may construct a URL from parts by calling {@link
* #toURL()}.
*/
public final class BlobURLParts {
public final class BlobUrlParts {
private String scheme;
private String host;
private String containerName;
Expand All @@ -33,9 +33,9 @@ public final class BlobURLParts {
private Map<String, String[]> unparsedParameters;

/**
* Initializes a BlobURLParts object which helps aid in the construction of a Blob Storage URL.
* Initializes a BlobUrlParts object which helps aid in the construction of a Blob Storage URL.
*/
public BlobURLParts() {
public BlobUrlParts() {
unparsedParameters = new HashMap<>();
}

Expand All @@ -52,9 +52,9 @@ public String getScheme() {
* Sets the URL scheme, ex. "https://".
*
* @param scheme The URL scheme.
* @return the updated BlobURLParts object.
* @return the updated BlobUrlParts object.
*/
public BlobURLParts setScheme(String scheme) {
public BlobUrlParts setScheme(String scheme) {
this.scheme = scheme;
return this;
}
Expand All @@ -72,9 +72,9 @@ public String getHost() {
* Sets the URL host, ex. "account.blob.core.windows.net".
*
* @param host The URL host.
* @return the updated BlobURLParts object.
* @return the updated BlobUrlParts object.
*/
public BlobURLParts setHost(String host) {
public BlobUrlParts setHost(String host) {
this.host = host;
return this;
}
Expand All @@ -92,9 +92,9 @@ public String getBlobContainerName() {
* Sets the container name that will be used as part of the URL path.
*
* @param containerName The container nme.
* @return the updated BlobURLParts object.
* @return the updated BlobUrlParts object.
*/
public BlobURLParts setContainerName(String containerName) {
public BlobUrlParts setContainerName(String containerName) {
this.containerName = containerName;
return this;
}
Expand All @@ -112,9 +112,9 @@ public String getBlobName() {
* Sets the blob name that will be used as part of the URL path.
*
* @param blobName The blob name.
* @return the updated BlobURLParts object.
* @return the updated BlobUrlParts object.
*/
public BlobURLParts setBlobName(String blobName) {
public BlobUrlParts setBlobName(String blobName) {
this.blobName = blobName;
return this;
}
Expand All @@ -132,9 +132,9 @@ public String getSnapshot() {
* Sets the snapshot identifier that will be used as part of the query string if set.
*
* @param snapshot The snapshot identifier.
* @return the updated BlobURLParts object.
* @return the updated BlobUrlParts object.
*/
public BlobURLParts setSnapshot(String snapshot) {
public BlobUrlParts setSnapshot(String snapshot) {
this.snapshot = snapshot;
return this;
}
Expand All @@ -154,9 +154,9 @@ public BlobServiceSasQueryParameters getSasQueryParameters() {
* generate the SAS token for this URL.
*
* @param blobServiceSasQueryParameters The SAS query parameters.
* @return the updated BlobURLParts object.
* @return the updated BlobUrlParts object.
*/
public BlobURLParts setSasQueryParameters(BlobServiceSasQueryParameters blobServiceSasQueryParameters) {
public BlobUrlParts setSasQueryParameters(BlobServiceSasQueryParameters blobServiceSasQueryParameters) {
this.blobServiceSasQueryParameters = blobServiceSasQueryParameters;
return this;
}
Expand All @@ -174,9 +174,9 @@ public Map<String, String[]> getUnparsedParameters() {
* Sets the query string parameters that aren't part of the SAS token that will be used by this URL.
*
* @param unparsedParameters The non-SAS token query string values.
* @return the updated BlobURLParts object.
* @return the updated BlobUrlParts object.
*/
public BlobURLParts setUnparsedParameters(Map<String, String[]> unparsedParameters) {
public BlobUrlParts setUnparsedParameters(Map<String, String[]> unparsedParameters) {
this.unparsedParameters = unparsedParameters;
return this;
}
Expand All @@ -185,7 +185,7 @@ public BlobURLParts setUnparsedParameters(Map<String, String[]> unparsedParamete
* Converts the blob URL parts to a {@link URL}.
*
* @return A {@code URL} to the blob resource composed of all the elements in this object.
* @throws MalformedURLException The fields present on the BlobURLParts object were insufficient to construct a
* @throws MalformedURLException The fields present on the BlobUrlParts object were insufficient to construct a
* valid URL or were ill-formatted.
*/
public URL toURL() throws MalformedURLException {
Expand Down Expand Up @@ -221,16 +221,16 @@ public URL toURL() throws MalformedURLException {
}

/**
* URLParser parses a string URL initializing BlobURLParts' fields including any SAS-related and snapshot query
* URLParser parses a string URL initializing BlobUrlParts' fields including any SAS-related and snapshot query
* parameters. Any other query parameters remain in the UnparsedParams field. This method overwrites all fields
* in the BlobURLParts object.
* in the BlobUrlParts object.
*
* @param url The string URL to be parsed.
* @param logger Logger associated to the calling class to log a {@link MalformedURLException}.
* @return A {@link BlobURLParts} object containing all the components of a BlobURL.
* @return A {@link BlobUrlParts} object containing all the components of a BlobURL.
* @throws IllegalArgumentException If the {@code url} is malformed.
*/
public static BlobURLParts parse(String url, ClientLogger logger) {
public static BlobUrlParts parse(String url, ClientLogger logger) {
try {
return parse(new URL(url));
} catch (MalformedURLException e) {
Expand All @@ -240,16 +240,16 @@ public static BlobURLParts parse(String url, ClientLogger logger) {
}

/**
* Parses an existing URL into a BlobURLParts.
* Parses an existing URL into a BlobUrlParts.
*
* <p>Query parameters will be parsed into two properties, {@link BlobServiceSasQueryParameters} which contains
* all SAS token related values and {@link #getUnparsedParameters() unparsedParameters} which is all other query
* parameters.</p>
*
* @param url The {@code URL} to be parsed.
* @return A {@link BlobURLParts} object containing all the components of a BlobURL.
* @return A {@link BlobUrlParts} object containing all the components of a BlobURL.
*/
public static BlobURLParts parse(URL url) {
public static BlobUrlParts parse(URL url) {

final String scheme = url.getProtocol();
final String host = url.getHost();
Expand Down Expand Up @@ -287,7 +287,7 @@ public static BlobURLParts parse(URL url) {
BlobServiceSasQueryParameters blobServiceSasQueryParameters =
new BlobServiceSasQueryParameters(queryParamsMap, true);

return new BlobURLParts()
return new BlobUrlParts()
.setScheme(scheme)
.setHost(host)
.setContainerName(containerName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
import java.time.Duration;

/**
* HTTPGetterInfo is a passed to the getter function of a reliable download to specify parameters needed for the GET
* HttpGetterInfo is a passed to the getter function of a reliable download to specify parameters needed for the GET
* request.
*/
public final class HTTPGetterInfo {
public final class HttpGetterInfo {
private long offset = 0;

private Long count = null;
Expand All @@ -31,9 +31,9 @@ public long getOffset() {
* Sets the start offset that is used when creating the Range header. If unchanged this will default to 0.
*
* @param offset Start offset
* @return the updated HTTPGetterInfo object
* @return the updated HttpGetterInfo object
*/
public HTTPGetterInfo setOffset(long offset) {
public HttpGetterInfo setOffset(long offset) {
this.offset = offset;
return this;
}
Expand All @@ -51,9 +51,9 @@ public Long getCount() {
* default and indicates that the entire rest of the blob should be retrieved.
*
* @param count Count of bytes
* @return the updated HTTPGetterInfo object
* @return the updated HttpGetterInfo object
*/
public HTTPGetterInfo setCount(Long count) {
public HttpGetterInfo setCount(Long count) {
if (count != null) {
Utility.assertInBounds("count", count, 0, Long.MAX_VALUE);
}
Expand All @@ -76,9 +76,9 @@ public String getETag() {
* properties}. Defaults to null.
*
* @param eTag Resource's eTag
* @return the updated HTTPGetterInfo object
* @return the updated HttpGetterInfo object
*/
public HTTPGetterInfo setETag(String eTag) {
public HttpGetterInfo setETag(String eTag) {
this.eTag = eTag;
return this;
}
Expand Down
Loading