Skip to content
This repository was archived by the owner on Jul 19, 2024. It is now read-only.

Commit 3cf48a3

Browse files
committed
Merge latest dev branch into release70
2 parents b97d088 + 3e337ed commit 3cf48a3

29 files changed

+92
-77
lines changed

ChangeLog.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
2018.01.11 Version 7.0.0
1+
2018.02.05 Version 7.0.0
22
* Support for 2017-07-29 REST version. Please see our REST api documentation and blogs for information about the related added features.
33
* Added support for soft delete feature. If a delete retention policy is enabled through the set service properties API, then blobs or snapshots can be deleted softly and retained for a specified number of days, before being permanently removed by garbage collection.
44
* When a storage request fails, the error code may now be retrieved directly from the RequestResult and StorageException classes. This error code is populated even in cases where there is no StorageExtendedErrorInformation available, such as in calls to FetchAttributes.
@@ -7,6 +7,7 @@
77
* Improved performance when streaming directly from a FileInputStream to avoid unnecessary buffering.
88
* Switched to using fixed length streaming mode in the HTTP client to avoid unnecessary buffering.
99
* Upgraded Key Vault dependency to 1.0.
10+
* Fixed a bug preventing openInputStream from working on a blob snapshot.
1011

1112
2017.11.01 Version 6.1.0
1213
* Added support for the last time the tier was modified.

microsoft-azure-storage-test/src/com/microsoft/azure/storage/blob/CloudBlockBlobTests.java

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
import java.io.FileInputStream;
4444
import java.io.FileOutputStream;
4545
import java.io.IOException;
46+
import java.io.InputStream;
4647
import java.net.HttpURLConnection;
4748
import java.net.URI;
4849
import java.net.URISyntaxException;
@@ -1031,6 +1032,10 @@ public void testBlobSnapshotValidationTest() throws StorageException, URISyntaxE
10311032
byte[] retrievedBuff = outStream.toByteArray();
10321033
assertEquals(length, retrievedBuff.length);
10331034

1035+
InputStream inputStream = blobSnapshot.openInputStream();
1036+
retrievedBuff = inputStream.readAllBytes();
1037+
assertEquals(length, retrievedBuff.length);
1038+
10341039
// Read operation should work fine.
10351040
blobSnapshot.downloadAttributes();
10361041

@@ -1041,6 +1046,11 @@ public void testBlobSnapshotValidationTest() throws StorageException, URISyntaxE
10411046
blobSnapshotUsingRootUri.download(outStream);
10421047
retrievedBuff = outStream.toByteArray();
10431048
assertEquals(length, retrievedBuff.length);
1049+
1050+
inputStream = blobSnapshotUsingRootUri.openInputStream();
1051+
retrievedBuff = inputStream.readAllBytes();
1052+
assertEquals(length, retrievedBuff.length);
1053+
10441054
assertEquals(blobSnapshot.getSnapshotID(), blobSnapshotUsingRootUri.getSnapshotID());
10451055

10461056
// Expect an IllegalArgumentException from upload.
@@ -1081,6 +1091,33 @@ public void testBlobSnapshotValidationTest() throws StorageException, URISyntaxE
10811091
catch (IllegalArgumentException e) {
10821092
assertEquals("Cannot perform this operation on a blob representing a snapshot.", e.getMessage());
10831093
}
1094+
1095+
// Expect an IllegalArgumentException from openOutputStream.
1096+
try {
1097+
blobSnapshotUsingRootUri.openOutputStream();
1098+
fail("Expect an IllegalArgumentException from openOutputStream");
1099+
}
1100+
catch (IllegalArgumentException e) {
1101+
assertEquals("Cannot perform this operation on a blob representing a snapshot.", e.getMessage());
1102+
}
1103+
1104+
// Expect an IllegalArgumentException from uploadBlock.
1105+
try {
1106+
blobSnapshotUsingRootUri.uploadBlock("foo", new ByteArrayInputStream(new byte[0]), 0);
1107+
fail("Expect an IllegalArgumentException from uploadBlock");
1108+
}
1109+
catch (IllegalArgumentException e) {
1110+
assertEquals("Cannot perform this operation on a blob representing a snapshot.", e.getMessage());
1111+
}
1112+
1113+
// Expect an IllegalArgumentException from commitBlockList.
1114+
try {
1115+
blobSnapshotUsingRootUri.commitBlockList(new ArrayList<BlockEntry>());
1116+
fail("Expect an IllegalArgumentException from commitBlockList");
1117+
}
1118+
catch (IllegalArgumentException e) {
1119+
assertEquals("Cannot perform this operation on a blob representing a snapshot.", e.getMessage());
1120+
}
10841121
}
10851122

10861123
/**

microsoft-azure-storage/src/com/microsoft/azure/storage/AccessCondition.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -346,9 +346,6 @@ public void applySourceConditionToRequest(final HttpURLConnection request) {
346346
* @param request
347347
* A <code>java.net.HttpURLConnection</code> object that represents the request to which the condition is
348348
* being applied.
349-
*
350-
* @throws StorageException
351-
* If there is an error parsing the date value of the access condition.
352349
*/
353350
public void applyAppendConditionToRequest(final HttpURLConnection request) {
354351
if (this.ifMaxSizeLessThanOrEqual != null) {

microsoft-azure-storage/src/com/microsoft/azure/storage/LoggingProperties.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public final class LoggingProperties {
2727
private String version = "1.0";
2828

2929
/**
30-
* An <code>EnumSet<code> of <code>LoggingOperations</code> that represents which storage operations should be logged.
30+
* An <code>EnumSet</code> of <code>LoggingOperations</code> that represents which storage operations should be logged.
3131
*/
3232
private EnumSet<LoggingOperations> logOperationTypes = EnumSet.noneOf(LoggingOperations.class);
3333

@@ -37,9 +37,9 @@ public final class LoggingProperties {
3737
private Integer retentionIntervalInDays;
3838

3939
/**
40-
* Gets an <code>EnumSet<code> of <code>{@link LoggingOperations}</code> that represents which storage operations should be logged.
40+
* Gets an <code>EnumSet</code> of <code>{@link LoggingOperations}</code> that represents which storage operations should be logged.
4141
*
42-
* @return An <code>EnumSet<code> of <code>{@link LoggingOperations}</code>.
42+
* @return An <code>EnumSet</code> of <code>{@link LoggingOperations}</code>.
4343
*/
4444
public EnumSet<LoggingOperations> getLogOperationTypes() {
4545
return this.logOperationTypes;
@@ -67,7 +67,7 @@ public String getVersion() {
6767
* Sets the <code>{@link LoggingOperations}</code> for which storage operations should be logged.
6868
*
6969
* @param logOperationTypes
70-
* An <code>EnumSet<code> of <code>{@link LoggingOperations}</code> to set.
70+
* An <code>EnumSet</code> of <code>{@link LoggingOperations}</code> to set.
7171
*/
7272
public void setLogOperationTypes(final EnumSet<LoggingOperations> logOperationTypes) {
7373
this.logOperationTypes = logOperationTypes;

microsoft-azure-storage/src/com/microsoft/azure/storage/OperationContext.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ public OperationContext() {
186186
/**
187187
* Gets the client side trace ID.
188188
*
189-
* @return A <code>String</cod> which represents the client request ID.
189+
* @return A <code>String</code> which represents the client request ID.
190190
*/
191191
public String getClientRequestID() {
192192
return this.clientRequestID;

microsoft-azure-storage/src/com/microsoft/azure/storage/RetryInfo.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public RetryInfo() {
4545
}
4646

4747
/**
48-
* Initializes a new instance of the {@link "RetryInfo"} class.
48+
* Initializes a new instance of the {@link RetryInfo} class.
4949
*
5050
* @param retryContext
5151
* The {@link RetryContext} object that was passed in to the retry policy.
@@ -114,7 +114,7 @@ public void setUpdatedLocationMode(LocationMode updatedLocationMode) {
114114
}
115115

116116
/**
117-
* Returns a string that represents the current {@link "RetryInfo"} instance.
117+
* Returns a string that represents the current {@link RetryInfo} instance.
118118
*
119119
* @return A <code>String</code> which represents the current <code>RetryInfo</code> instance.
120120
*/

microsoft-azure-storage/src/com/microsoft/azure/storage/SharedAccessPolicyHandler.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ private SharedAccessPolicyHandler(final Class<T> cls) {
5858
* @return the HashMap of SharedAccessPolicies from the response
5959
* @throws SAXException
6060
* @throws ParserConfigurationException
61-
* @throws ParseException
62-
* if a date is incorrectly encoded in the stream
6361
* @throws IOException
6462
*/
6563
public static <T extends SharedAccessPolicy> HashMap<String, T> getAccessIdentifiers(final InputStream stream,

microsoft-azure-storage/src/com/microsoft/azure/storage/analytics/CloudAnalyticsClient.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -385,9 +385,7 @@ public Iterable<LogRecord> listLogRecords(StorageService service, Date startTime
385385
* @param logBlobs
386386
* An {@link Iterable} of blobs to parse LogRecords from.
387387
* @return
388-
* An enumerable collection of objects that implement {@link LogRecords} and are retrieved lazily.
389-
* @throws StorageException
390-
* @throws URISyntaxException
388+
* An enumerable collection of objects that implement {@link LogRecord} and are retrieved lazily.
391389
*/
392390
public static Iterable<LogRecord> parseLogBlobs(Iterable<ListBlobItem> logBlobs) {
393391
Utility.assertNotNull("logBlobs", logBlobs);
@@ -398,12 +396,10 @@ public static Iterable<LogRecord> parseLogBlobs(Iterable<ListBlobItem> logBlobs)
398396
/**
399397
* Returns an enumerable collection of log records, retrieved lazily.
400398
*
401-
* @param logBlobs
402-
* An {@link Iterable} of blobs to parse LogRecords from.
399+
* @param logBlob
400+
* A single blob to parse LogRecords from.
403401
* @return
404-
* An enumerable collection of objects that implement {@link LogRecords} and are retrieved lazily.
405-
* @throws StorageException
406-
* @throws URISyntaxException
402+
* An enumerable collection of objects that implement {@link LogRecord} and are retrieved lazily.
407403
*/
408404
public static Iterable<LogRecord> parseLogBlob(ListBlobItem logBlob) {
409405
Utility.assertNotNull("logBlob", logBlob);

microsoft-azure-storage/src/com/microsoft/azure/storage/blob/BlobContainerProperties.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,11 @@ public LeaseDuration getLeaseDuration() {
107107

108108
/**
109109
* Gets the public access level for the container.
110-
* This field should only be set using the container's {@link #create(BlobContainerPublicAccessType,
111-
* BlobRequestOptions, OperationContext) create} method or
112-
* {@link #uploadPermissions(BlobContainerPermissions) uploadPermissions} method.
113-
*
114-
* @return A <code>{@link BlobContainerPublicAccessLevel}</code> that specifies the level of public access
110+
* This field should only be set using the container's {@link CloudBlobContainer#create(BlobContainerPublicAccessType,
111+
* BlobRequestOptions, com.microsoft.azure.storage.OperationContext) create} method or
112+
* {@link CloudBlobContainer#uploadPermissions(BlobContainerPermissions) uploadPermissions} method.
113+
*
114+
* @return A <code>{@link BlobContainerPublicAccessType}</code> that specifies the level of public access
115115
* that is allowed on the container.
116116
*/
117117
public BlobContainerPublicAccessType getPublicAccess() {
@@ -170,9 +170,10 @@ protected void setLeaseDuration(final LeaseDuration leaseDuration) {
170170

171171
/**
172172
* Sets the public access level on the container.
173-
* This should only be set using the container's {@link #create(BlobContainerPublicAccessType,
174-
* BlobRequestOptions, OperationContext) create} method or
175-
* {@link #uploadPermissions(BlobContainerPermissions) uploadPermissions} method.
173+
* This should only be set using the container's {@link CloudBlobContainer#create(BlobContainerPublicAccessType,
174+
* BlobRequestOptions, com.microsoft.azure.storage.OperationContext) create} method or
175+
* {@link CloudBlobContainer#uploadPermissions(BlobContainerPermissions) uploadPermissions} method.
176+
*
176177
* @param publicAccess
177178
* A <code>{@link BlobContainerPublicAccessType}</code> object
178179
* which represents the public access level on the container.

microsoft-azure-storage/src/com/microsoft/azure/storage/blob/BlobInputStream.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ else if (numberOfBytesRead == 0) {
337337
* elements <code>b[0]</code> through <code>b[k-1]</code>, leaving elements <code>b[k]</code> through
338338
* <code>b[b.length-1]</code> unaffected.
339339
*
340-
* The <code>read(b) method for class {@link InputStream} has the same effect as:
340+
* The <code>read(b)</code> method for class {@link InputStream} has the same effect as:
341341
*
342342
* <code>read(b, 0, b.length)</code>
343343
*

0 commit comments

Comments
 (0)