Skip to content

Commit

Permalink
Merge pull request Azure#403 from rickle-msft/dev_breaking
Browse files Browse the repository at this point in the history
Dev breaking
  • Loading branch information
rickle-msft authored Nov 14, 2018
2 parents cc31227 + d6fff51 commit 8022a66
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 40 deletions.
1 change: 1 addition & 0 deletions BreakingChanges.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* HTTPGetterInfo was made an internal type as it is an internal implementation detail.
* DownloadResponse constructor was made internal as there is no need for customers to construct their own responses; all HTTP responses should be generated internally.
* Removed DEFAULT and NONE static variables. Empty constructors should be used instead. DEFAULT static values were error prone and unsafe to use because although the field was final, the objects were mutable, so it was possible the value could be changed accidentally and alter the behavior of the program.
* Changed *ListingDetails to *ListDetails. These name changes are to mitigate conflicts with v8, allowing for side-by-side loading of different versions, which may help with upgrading.

2018.08.11 Version 10.1.0
* Interfaces for helper types updated to be more consistent throughout the library. All types, with the exception of the options for pipeline factories, use a fluent pattern.
Expand Down
1 change: 1 addition & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ XXXX.XX.XX Version XX.X.X
* Optimized the TransferManager download to file method to skip the initial HEAD request.
* Added an option to configure that maximum size data that will be uploaded in a single shot via the TransferManager.
* Added request Http Method, URL, and headers to logging messages.
* Changed *ListingDetails to *ListDetails. These name changes are to mitigate conflicts with v8, allowing for side-by-side loading of different versions, which may help with upgrading.

2018.10.29 Version 10.2.0
* Added overloads which only accept the required parameters.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* changing the details for a different listing operation requires construction of a new object. Null may be passed if
* none of the options are desirable.
*/
public final class BlobListingDetails {
public final class BlobListDetails {

private boolean copy;

Expand All @@ -36,7 +36,7 @@ public final class BlobListingDetails {

private boolean deletedBlobs;

public BlobListingDetails() {
public BlobListDetails() {
}

/**
Expand All @@ -51,7 +51,7 @@ public boolean copy() {
* Whether blob metadata related to any current or previous Copy Blob operation should be included in the
* response.
*/
public BlobListingDetails withCopy(boolean copy) {
public BlobListDetails withCopy(boolean copy) {
this.copy = copy;
return this;
}
Expand All @@ -66,7 +66,7 @@ public boolean metadata() {
/**
* Whether blob metadata should be returned.
*/
public BlobListingDetails withMetadata(boolean metadata) {
public BlobListDetails withMetadata(boolean metadata) {
this.metadata = metadata;
return this;
}
Expand All @@ -81,7 +81,7 @@ public boolean snapshots() {
/**
* Whether snapshots should be returned. Snapshots are listed from oldest to newest.
*/
public BlobListingDetails withSnapshots(boolean snapshots) {
public BlobListDetails withSnapshots(boolean snapshots) {
this.snapshots = snapshots;
return this;
}
Expand All @@ -98,7 +98,7 @@ public boolean uncommittedBlobs() {
* Whether blobs for which blocks have been uploaded, but which have not been committed using Put Block List,
* should be included in the response.
*/
public BlobListingDetails withUncommittedBlobs(boolean uncommittedBlobs) {
public BlobListDetails withUncommittedBlobs(boolean uncommittedBlobs) {
this.uncommittedBlobs = uncommittedBlobs;
return this;
}
Expand All @@ -113,7 +113,7 @@ public boolean deletedBlobs() {
/**
* Whether blobs which have been soft deleted should be returned.
*/
public BlobListingDetails withDeletedBlobs(boolean deletedBlobs) {
public BlobListDetails withDeletedBlobs(boolean deletedBlobs) {
this.deletedBlobs = deletedBlobs;
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
* requests, so changing the details for a different listing operation requires construction of a new object. Null may
* be passed if none of the options are desirable.
*/
public final class ContainerListingDetails {
public final class ContainerListDetails {

private boolean metadata;

public ContainerListingDetails() {
public ContainerListDetails() {

}

Expand All @@ -40,14 +40,14 @@ public boolean metadata() {
/**
* Whether metadata should be returned.
*/
public ContainerListingDetails withMetadata(boolean metadata) {
public ContainerListDetails withMetadata(boolean metadata) {
this.metadata = metadata;
return this;
}

/*
This is used internally to convert the details structure into the appropriate type to pass to the protocol layer.
It is intended to mirror the BlobListingDetails.toList() method, but is slightly different since there is only one
It is intended to mirror the BlobListDetails.toList() method, but is slightly different since there is only one
possible value here currently. The customer should never have need for this.
*/
ListContainersIncludeType toIncludeType() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,27 @@
*/
public final class ListBlobsOptions {

private BlobListingDetails details;
private BlobListDetails details;

private String prefix;

private Integer maxResults;

public ListBlobsOptions() {
this.details = new BlobListingDetails();
this.details = new BlobListDetails();
}

/**
* {@link BlobListingDetails}
* {@link BlobListDetails}
*/
public BlobListingDetails details() {
public BlobListDetails details() {
return details;
}

/**
* {@link BlobListingDetails}
* {@link BlobListDetails}
*/
public ListBlobsOptions withDetails(BlobListingDetails details) {
public ListBlobsOptions withDetails(BlobListDetails details) {
this.details = details;
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,27 @@
*/
public final class ListContainersOptions {

private ContainerListingDetails details;
private ContainerListDetails details;

private String prefix;

private Integer maxResults;

public ListContainersOptions() {
this.details = new ContainerListingDetails();
this.details = new ContainerListDetails();
}

/**
* {@link ContainerListingDetails}
* {@link ContainerListDetails}
*/
public ContainerListingDetails details() {
public ContainerListDetails details() {
return details;
}

/**
* {@link ContainerListingDetails}
* {@link ContainerListDetails}
*/
public ListContainersOptions withDetails(ContainerListingDetails details) {
public ListContainersOptions withDetails(ContainerListDetails details) {
this.details = details;
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,6 @@ public static Single<CommonRestResponse> uploadFileToBlockBlob(final Asynchronou
// i * blockLength could be a long, so we need a cast to prevent overflow.
Flowable<ByteBuffer> data = FlowableUtil.readFile(file, i * (long)blockLength, count);

// Report progress as necessary.
data = ProgressReporter.addParallelProgressReporting(data, optionsReal.progressReceiver(),
progressLock, totalProgress);

// Report progress as necessary.
data = ProgressReporter.addParallelProgressReporting(data, optionsReal.progressReceiver(),
progressLock, totalProgress);
Expand Down
24 changes: 12 additions & 12 deletions src/test/java/com/microsoft/azure/storage/ContainerAPITest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ class ContainerAPITest extends APISpec {

def "List blobs flat options copy"() {
setup:
ListBlobsOptions options = new ListBlobsOptions().withDetails(new BlobListingDetails().withCopy(true))
ListBlobsOptions options = new ListBlobsOptions().withDetails(new BlobListDetails().withCopy(true))
String normalName = "a" + generateBlobName()
String copyName = "c" + generateBlobName()
String metadataName = "m" + generateBlobName()
Expand All @@ -736,7 +736,7 @@ class ContainerAPITest extends APISpec {

def "List blobs flat options metadata"() {
setup:
ListBlobsOptions options = new ListBlobsOptions().withDetails(new BlobListingDetails().withMetadata(true))
ListBlobsOptions options = new ListBlobsOptions().withDetails(new BlobListDetails().withMetadata(true))
String normalName = "a" + generateBlobName()
String copyName = "c" + generateBlobName()
String metadataName = "m" + generateBlobName()
Expand All @@ -757,7 +757,7 @@ class ContainerAPITest extends APISpec {

def "List blobs flat options snapshots"() {
setup:
ListBlobsOptions options = new ListBlobsOptions().withDetails(new BlobListingDetails().withSnapshots(true))
ListBlobsOptions options = new ListBlobsOptions().withDetails(new BlobListDetails().withSnapshots(true))
String normalName = "a" + generateBlobName()
String copyName = "c" + generateBlobName()
String metadataName = "m" + generateBlobName()
Expand All @@ -776,7 +776,7 @@ class ContainerAPITest extends APISpec {

def "List blobs flat options uncommitted"() {
setup:
ListBlobsOptions options = new ListBlobsOptions().withDetails(new BlobListingDetails()
ListBlobsOptions options = new ListBlobsOptions().withDetails(new BlobListDetails()
.withUncommittedBlobs(true))
String normalName = "a" + generateBlobName()
String copyName = "c" + generateBlobName()
Expand All @@ -802,7 +802,7 @@ class ContainerAPITest extends APISpec {
bu.delete(null, null, null).blockingGet()

when:
List<BlobItem> blobs = cu.listBlobsFlatSegment(null, new ListBlobsOptions().withDetails(new BlobListingDetails()
List<BlobItem> blobs = cu.listBlobsFlatSegment(null, new ListBlobsOptions().withDetails(new BlobListDetails()
.withDeletedBlobs(true)), null).blockingGet().body().segment().blobItems()

then:
Expand Down Expand Up @@ -831,7 +831,7 @@ class ContainerAPITest extends APISpec {

def "List blobs flat options maxResults"() {
setup:
ListBlobsOptions options = new ListBlobsOptions().withDetails(new BlobListingDetails().withCopy(true)
ListBlobsOptions options = new ListBlobsOptions().withDetails(new BlobListDetails().withCopy(true)
.withSnapshots(true).withUncommittedBlobs(true)).withMaxResults(2)
String normalName = "a" + generateBlobName()
String copyName = "c" + generateBlobName()
Expand Down Expand Up @@ -930,7 +930,7 @@ class ContainerAPITest extends APISpec {

def "List blobs hier options copy"() {
setup:
ListBlobsOptions options = new ListBlobsOptions().withDetails(new BlobListingDetails().withCopy(true))
ListBlobsOptions options = new ListBlobsOptions().withDetails(new BlobListDetails().withCopy(true))
String normalName = "a" + generateBlobName()
String copyName = "c" + generateBlobName()
String metadataName = "m" + generateBlobName()
Expand All @@ -955,7 +955,7 @@ class ContainerAPITest extends APISpec {

def "List blobs hier options metadata"() {
setup:
ListBlobsOptions options = new ListBlobsOptions().withDetails(new BlobListingDetails().withMetadata(true))
ListBlobsOptions options = new ListBlobsOptions().withDetails(new BlobListDetails().withMetadata(true))
String normalName = "a" + generateBlobName()
String copyName = "c" + generateBlobName()
String metadataName = "m" + generateBlobName()
Expand All @@ -977,7 +977,7 @@ class ContainerAPITest extends APISpec {

def "List blobs hier options uncommitted"() {
setup:
ListBlobsOptions options = new ListBlobsOptions().withDetails(new BlobListingDetails()
ListBlobsOptions options = new ListBlobsOptions().withDetails(new BlobListDetails()
.withUncommittedBlobs(true))
String normalName = "a" + generateBlobName()
String copyName = "c" + generateBlobName()
Expand Down Expand Up @@ -1005,7 +1005,7 @@ class ContainerAPITest extends APISpec {

when:
List<BlobItem> blobs = cu.listBlobsHierarchySegment(null, "",
new ListBlobsOptions().withDetails(new BlobListingDetails().withDeletedBlobs(true)), null).blockingGet()
new ListBlobsOptions().withDetails(new BlobListDetails().withDeletedBlobs(true)), null).blockingGet()
.body().segment().blobItems()

then:
Expand Down Expand Up @@ -1035,7 +1035,7 @@ class ContainerAPITest extends APISpec {

def "List blobs hier options maxResults"() {
setup:
ListBlobsOptions options = new ListBlobsOptions().withDetails(new BlobListingDetails().withCopy(true)
ListBlobsOptions options = new ListBlobsOptions().withDetails(new BlobListDetails().withCopy(true)
.withUncommittedBlobs(true)).withMaxResults(1)
String normalName = "a" + generateBlobName()
String copyName = "c" + generateBlobName()
Expand All @@ -1054,7 +1054,7 @@ class ContainerAPITest extends APISpec {
@Unroll
def "List blobs hier options fail"() {
when:
def options = new ListBlobsOptions().withDetails(new BlobListingDetails().withSnapshots(snapshots))
def options = new ListBlobsOptions().withDetails(new BlobListDetails().withSnapshots(snapshots))
.withMaxResults(maxResults)
cu.listBlobsHierarchySegment(null, null, options, null)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class ServiceAPITest extends APISpec {

expect:
primaryServiceURL.listContainersSegment(null,
new ListContainersOptions().withDetails(new ContainerListingDetails().withMetadata(true))
new ListContainersOptions().withDetails(new ContainerListDetails().withMetadata(true))
.withPrefix("aaa" + containerPrefix), null).blockingGet().body().containerItems()
.get(0).metadata() == metadata
// Container with prefix "aaa" will not be cleaned up by normal test cleanup.
Expand Down

0 comments on commit 8022a66

Please sign in to comment.