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

Commit d34a89b

Browse files
committed
Revert changes for version 5.1.0
1 parent 0b8a579 commit d34a89b

34 files changed

+218
-1416
lines changed

BreakingChanges.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
Changes in 5.0.0
1+
Changes in 5.0.0
22

33
BLOB
44
* getQualifiedUri() has been deprecated. Please use getSnapshotQualifiedUri() instead. This new function will return the blob including the snapshot (if present) and no SAS token.
55
* getQualifiedStorageUri() has been deprecated. Please use getSnapshotQualifiedStorageUri() instead. This new function will return the blob including the snapshot (if present) and no SAS token.
66
* Fixed a bug where copying from a blob that included a SAS token and a snapshot did not use the SAS token.
77

8-
FILE
8+
FILE
99
* Fixed a bug where copying from a blob that included a SAS token and a snapshot did not use the SAS token.
10-
10+
1111
QUEUE
1212
* For addMessage() the CloudQueueMessage message passed in will be populated with the pop receipt, insertion/expiration time, and message ID.
1313

@@ -164,8 +164,8 @@ Changes in 0.5.0
164164

165165
OTHER
166166
* The packaging structure has changed to
167-
1. com.microsoft.windowsazure.storage � RetryPolicies, LocationMode, StorageException, Storage Credentials etc. Basically all public classes that are common across services.
168-
2. com.microsoft.windowsazure.storage.core � These classes are reserved for internal use and users never have to include this namespace in their projects.
167+
1. com.microsoft.windowsazure.storage � RetryPolicies, LocationMode, StorageException, Storage Credentials etc. Basically all public classes that are common across services.
168+
2. com.microsoft.windowsazure.storage.core � These classes are reserved for internal use and users never have to include this namespace in their projects.
169169
3. com.microsoft.windowsazure.storage.blob
170170
4. com.microsoft.windowsazure.storage.queue
171171
5. com.microsoft.windowsazure.storage.table

ChangeLog.txt

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
1-
2017.05.04 Version 5.1.0
2-
* Fixed Exists() calls on Shares and Directories to now populate metadata. This was already being done for Files.
3-
* Changed blob constants to support up to 256 MB on put blob for block blobs. The default value for put blob threshold has also been updated to half of the maximum, or 128 MB currently.
4-
* Fixed a bug that prevented setting content MD5 to true when creating a new file.
5-
* Fixed a bug where access conditions, options, and operation context were not being passed when calling openWriteExisting() on a page blob or a file.
6-
* Fixed a bug where an exception was being thrown on a range get of a blob or file when the options disableContentMD5Validation is set to false and useTransactionalContentMD5 is set to true and there is no overall MD5.
7-
* Fixed a bug where retries were happening immediately if a socket exception was thrown.
8-
* In CloudFileShareProperties, setShareQuota() no longer asserts in bounds. This check has been moved to create() and uploadProperties() in CloudFileShare.
9-
101
2017.01.18 Version 5.0.0
112
* Prefix support for listing files and directories.
123
* Added support for setting public access when creating a blob container

README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# Microsoft Azure Storage SDK for Java
1+
#Microsoft Azure Storage SDK for Java
22

33
This project provides a client library in Java that makes it easy to consume Microsoft Azure Storage services. For documentation please see the Microsoft Azure [Java Developer Center](http://azure.microsoft.com/en-us/develop/java/) and the [JavaDocs](http://azure.github.io/azure-storage-java/).
44

55
> If you are looking for the Azure Storage Android SDK, please visit [https://github.com/Azure/azure-storage-android](https://github.com/Azure/azure-storage-android).
66
7-
# Features
7+
#Features
88
* Blob
99
* Create/Read/Update/Delete containers
1010
* Create/Read/Update/Delete blobs
@@ -19,34 +19,34 @@ This project provides a client library in Java that makes it easy to consume Mic
1919
* Batch operations
2020
* Advanced Table Operations
2121

22-
# Getting Started
22+
#Getting Started
2323

24-
## Download
25-
### Option 1: Via Maven
24+
##Download
25+
###Option 1: Via Maven
2626

2727
To get the binaries of this library as distributed by Microsoft, ready for use within your project, you can use Maven.
2828

2929
```xml
3030
<dependency>
3131
<groupId>com.microsoft.azure</groupId>
3232
<artifactId>azure-storage</artifactId>
33-
<version>5.1.0</version>
33+
<version>5.0.0</version>
3434
</dependency>
3535
```
3636

37-
### Option 2: Source Via Git
37+
###Option 2: Source Via Git
3838

3939
To get the source code of the SDK via git just type:
4040

4141
git clone git://github.com/Azure/azure-storage-java.git
42-
cd ./azure-storage-java
42+
cd ./azure-storage-java/microsoft-azure-storage
4343
mvn compile
4444

45-
### Option 3: Source Zip
45+
###Option 3: Source Zip
4646

4747
To download a copy of the source code, click "Download ZIP" on the right side of the page or click [here](https://github.com/Azure/azure-storage-java/archive/master.zip). Unzip and navigate to the microsoft-azure-storage folder.
4848

49-
## Minimum Requirements
49+
##Minimum Requirements
5050

5151
* Java 1.6+
5252
* [Jackson-Core](https://github.com/FasterXML/jackson-core) is used for JSON parsing.
@@ -58,13 +58,13 @@ The two dependencies, [Jackson-Core](https://github.com/FasterXML/jackson-core)
5858

5959
SLF4J is only needed if you enable logging through the OperationContext class. If you plan to use logging, please also download an [SLF4J binding](http://repo2.maven.org/maven2/org/slf4j/) which will link the SLF4J API with the logging implementation of your choice. Simple is a good default. See the [SLF4J user manual](http://www.slf4j.org/manual.html) for more information.
6060

61-
## Usage
61+
##Usage
6262

6363
To use this SDK to call Microsoft Azure storage services, you need to first [create an account](https://account.windowsazure.com/signup).
6464

6565
Samples are provided in the microsoft-azure-storage-samples folder. The unit tests in microsoft-azure-storage-test can also be helpful.
6666

67-
## Code Sample
67+
##Code Sample
6868

6969
The following is a quick example on how to upload a file to azure blob and download it back. You may also download and view the samples in the microsoft-azure-storage-samples folder. For additional information on using the client libraries to access Azure services see the How To guides for [blobs](http://azure.microsoft.com/en-us/documentation/articles/storage-java-how-to-use-blob-storage/), [queues](http://azure.microsoft.com/en-us/documentation/articles/storage-java-how-to-use-queue-storage/), [tables](http://azure.microsoft.com/en-us/documentation/articles/storage-java-how-to-use-table-storage/) and the [general documentation](http://azure.microsoft.com/en-us/develop/java/).
7070

@@ -117,17 +117,17 @@ public class BlobSample {
117117
}
118118
```
119119

120-
# Need Help?
120+
#Need Help?
121121

122122
Be sure to check out the Microsoft Azure [Developer Forums on MSDN](http://social.msdn.microsoft.com/Forums/windowsazure/en-US/home?forum=windowsazuredata) or the [Developer Forums on Stack Overflow](http://stackoverflow.com/questions/tagged/azure+windows-azure-storage) if you have trouble with the provided code.
123123

124-
# Contribute Code or Provide Feedback
124+
#Contribute Code or Provide Feedback
125125

126126
If you would like to become an active contributor to this project please follow the instructions provided in [Azure Projects Contribution Guidelines](http://azure.github.io/guidelines/).
127127

128128
If you encounter any bugs with the library please file an issue in the [Issues](https://github.com/Azure/azure-storage-java/issues) section of the project.
129129

130-
# Learn More
130+
#Learn More
131131

132132
* [Azure Developer Center](http://azure.microsoft.com/en-us/develop/java/)
133133
* [Azure Storage Service](http://azure.microsoft.com/en-us/documentation/services/storage/)

microsoft-azure-storage-samples/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<dependency>
2727
<groupId>com.microsoft.azure</groupId>
2828
<artifactId>azure-storage</artifactId>
29-
<version>5.1.0</version>
29+
<version>5.0.0</version>
3030
</dependency>
3131
<dependency>
3232
<groupId>com.microsoft.azure</groupId>

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

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import java.io.FileOutputStream;
2424
import java.io.IOException;
2525
import java.net.URISyntaxException;
26-
import java.nio.charset.Charset;
2726
import java.security.InvalidAlgorithmParameterException;
2827
import java.security.InvalidKeyException;
2928
import java.security.NoSuchAlgorithmException;
@@ -144,41 +143,7 @@ else if (type == BlobType.APPEND_BLOB) {
144143
TestHelper.assertStreamsAreEqualAtIndex(stream, new ByteArrayInputStream(outputStream.toByteArray()), 0, 0,
145144
size, 2 * 1024);
146145
}
147-
148-
@Test
149-
public void testDownloadUnencryptedBlobWithEncryptionPolicy() throws StorageException, IOException, URISyntaxException, NoSuchAlgorithmException
150-
{
151-
String blobName = BlobTestHelper.generateRandomBlobNameWithPrefix("test");
152-
CloudBlockBlob blob = container.getBlockBlobReference(blobName);
153-
blob.deleteIfExists();
154-
155-
byte[] msg = "my message".getBytes();
156-
// Upload data without encryption
157-
blob.uploadFromByteArray(msg, 0, msg.length);
158-
159-
// Create options with encryption policy
160-
BlobRequestOptions options = new BlobRequestOptions();
161-
options.setEncryptionPolicy(new BlobEncryptionPolicy(new RsaKey("myKey", 1024), null));
162-
options.setRequireEncryption(true);
163-
164-
try {
165-
blob.downloadText(Charset.defaultCharset().name(), null, options, null);
166-
fail("Expect exception");
167-
}
168-
catch (StorageException e) {
169-
assertEquals(SR.ENCRYPTION_DATA_NOT_PRESENT_ERROR, e.getMessage());
170-
}
171-
172-
byte[] buffer = new byte[msg.length];
173-
try {
174-
blob.downloadRangeToByteArray(0, (long) buffer.length, buffer, 0, null, options, null);
175-
fail("Expect exception");
176-
}
177-
catch (StorageException e) {
178-
assertEquals(SR.ENCRYPTION_DATA_NOT_PRESENT_ERROR, e.getMessage());
179-
}
180-
}
181-
146+
182147
@Test
183148
public void testBlobEncryptionWithFile() throws URISyntaxException, StorageException, IOException,
184149
InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,11 +247,11 @@ public void testSingleBlobPutThresholdInBytes() throws URISyntaxException, Stora
247247
try {
248248
bClient.getDefaultRequestOptions().setSingleBlobPutThresholdInBytes(
249249
BlobConstants.MAX_SINGLE_UPLOAD_BLOB_SIZE_IN_BYTES + 1);
250-
fail("Cannot set upload blob threshold above 256 MB");
250+
fail("Cannot set upload blob threshold above 64 MB");
251251
}
252252
catch (IllegalArgumentException e) {
253253
assertEquals(
254-
"The argument is out of range. Argument name: singleBlobPutThresholdInBytes, Value passed: 268435457.",
254+
"The argument is out of range. Argument name: singleBlobPutThresholdInBytes, Value passed: 67108865.",
255255
e.getMessage());
256256
}
257257

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

Lines changed: 25 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
import com.microsoft.azure.storage.file.SharedAccessFilePermissions;
3434
import com.microsoft.azure.storage.file.SharedAccessFilePolicy;
3535

36+
import junit.framework.Assert;
37+
3638
import org.junit.After;
3739
import org.junit.Before;
3840
import org.junit.Test;
@@ -58,11 +60,33 @@
5860
import java.util.Random;
5961
import java.util.TimeZone;
6062

63+
import org.junit.After;
64+
import org.junit.Before;
65+
import org.junit.Test;
66+
import org.junit.experimental.categories.Category;
67+
68+
import com.microsoft.azure.storage.AccessCondition;
69+
import com.microsoft.azure.storage.Constants;
70+
import com.microsoft.azure.storage.NameValidator;
71+
import com.microsoft.azure.storage.OperationContext;
72+
import com.microsoft.azure.storage.RetryNoRetry;
73+
import com.microsoft.azure.storage.SendingRequestEvent;
74+
import com.microsoft.azure.storage.StorageCredentialsAnonymous;
75+
import com.microsoft.azure.storage.StorageCredentialsSharedAccessSignature;
6176
import com.microsoft.azure.storage.StorageErrorCodeStrings;
77+
import com.microsoft.azure.storage.StorageEvent;
78+
import com.microsoft.azure.storage.StorageException;
6279
import com.microsoft.azure.storage.TestRunners.CloudTests;
6380
import com.microsoft.azure.storage.TestRunners.DevFabricTests;
6481
import com.microsoft.azure.storage.TestRunners.DevStoreTests;
6582
import com.microsoft.azure.storage.TestRunners.SlowTests;
83+
import com.microsoft.azure.storage.core.Utility;
84+
import com.microsoft.azure.storage.file.CloudFile;
85+
import com.microsoft.azure.storage.file.CloudFileShare;
86+
import com.microsoft.azure.storage.file.FileProperties;
87+
import com.microsoft.azure.storage.file.FileTestHelper;
88+
import com.microsoft.azure.storage.file.SharedAccessFilePermissions;
89+
import com.microsoft.azure.storage.file.SharedAccessFilePolicy;
6690

6791
import static org.junit.Assert.*;
6892

@@ -994,44 +1018,6 @@ public void testLargeBlobUploadFromStreamTest() throws URISyntaxException, Stora
9941018
blockBlobRef.download(dstStream);
9951019
BlobTestHelper.assertStreamsAreEqual(srcStream, new ByteArrayInputStream(dstStream.toByteArray()));
9961020
}
997-
998-
@Test
999-
@Category({ DevFabricTests.class, DevStoreTests.class, SlowTests.class })
1000-
public void testLargeSinglePutBlobTest() throws URISyntaxException, StorageException, IOException {
1001-
final String blockBlobName = BlobTestHelper.generateRandomBlobNameWithPrefix("testBlockBlob");
1002-
final String blockBlobName2 = BlobTestHelper.generateRandomBlobNameWithPrefix("testBlockBlob");
1003-
final String blockBlobName3 = BlobTestHelper.generateRandomBlobNameWithPrefix("testBlockBlob");
1004-
final CloudBlockBlob blob = this.container.getBlockBlobReference(blockBlobName);
1005-
final CloudBlockBlob blob2 = this.container.getBlockBlobReference(blockBlobName2);
1006-
final CloudBlockBlob blob3 = this.container.getBlockBlobReference(blockBlobName3);
1007-
BlobRequestOptions options = new BlobRequestOptions();
1008-
options.setStoreBlobContentMD5(false);
1009-
options.setEncryptionPolicy(null);
1010-
try
1011-
{
1012-
byte[] buffer = BlobTestHelper.getRandomBuffer(256 * Constants.MB);
1013-
1014-
OperationContext operationContext = new OperationContext();
1015-
1016-
blob.uploadFromByteArray(buffer, 0, 128 * Constants.MB, null, null, operationContext);
1017-
assertEquals(1, operationContext.getRequestResults().size());
1018-
1019-
options.setSingleBlobPutThresholdInBytes(256 * Constants.MB);
1020-
blob2.uploadFromByteArray(buffer, 0, 256 * Constants.MB, null, options, operationContext);
1021-
assertEquals(1, operationContext.getRequestResults().size());
1022-
1023-
// Reduce threshold and upload data greater than the single put blob upload threshold
1024-
options.setSingleBlobPutThresholdInBytes(Constants.MB);
1025-
blob3.uploadFromByteArray(buffer, 0, 3 * Constants.MB, null, options, operationContext);
1026-
assertTrue(operationContext.getRequestResults().size() > 1);
1027-
}
1028-
finally
1029-
{
1030-
blob.delete();
1031-
blob2.delete();
1032-
blob3.delete();
1033-
}
1034-
}
10351021

10361022
@Test
10371023
@Category({ DevFabricTests.class, DevStoreTests.class })
@@ -1173,29 +1159,6 @@ public void testBlobUploadWithoutMD5Validation() throws URISyntaxException, Stor
11731159
assertEquals("MDAwMDAwMDA=", blockBlobRef2.properties.getContentMD5());
11741160
}
11751161

1176-
@Test
1177-
@Category({ DevFabricTests.class, DevStoreTests.class })
1178-
public void testVerifyTransactionalMD5ValidationMissingOverallMD5() throws URISyntaxException, StorageException, IOException {
1179-
final String blockBlobName = BlobTestHelper.generateRandomBlobNameWithPrefix("testBlockBlob");
1180-
final CloudBlockBlob blockBlobRef = this.container.getBlockBlobReference(blockBlobName);
1181-
1182-
final int length = 2 * 1024 * 1024;
1183-
ByteArrayInputStream srcStream = BlobTestHelper.getRandomDataStream(length);
1184-
BlobRequestOptions options = new BlobRequestOptions();
1185-
options.setSingleBlobPutThresholdInBytes(1024*1024);
1186-
options.setDisableContentMD5Validation(true);
1187-
options.setStoreBlobContentMD5(false);
1188-
1189-
blockBlobRef.upload(srcStream, -1, null, options, null);
1190-
1191-
options.setDisableContentMD5Validation(false);
1192-
options.setStoreBlobContentMD5(true);
1193-
options.setUseTransactionalContentMD5(true);
1194-
final CloudBlockBlob blockBlobRef2 = this.container.getBlockBlobReference(blockBlobName);
1195-
blockBlobRef2.downloadRange(1024, (long)1024, new ByteArrayOutputStream(), null, options, null);
1196-
assertNull(blockBlobRef2.getProperties().getContentMD5());
1197-
}
1198-
11991162
@Test
12001163
@Category({ DevFabricTests.class, DevStoreTests.class })
12011164
public void testBlockBlobUploadContentMD5() throws URISyntaxException, StorageException, IOException {
@@ -1235,7 +1198,7 @@ public void eventOccurred(SendingRequestEvent eventArg) {
12351198
}
12361199
};
12371200

1238-
length = BlobConstants.DEFAULT_SINGLE_BLOB_PUT_THRESHOLD_IN_BYTES + 1;
1201+
length = 33 * Constants.MB;
12391202
srcStream = BlobTestHelper.getRandomDataStream(length);
12401203

12411204
sendingRequestEventContext.getSendingRequestEventHandler().addListener(event);
@@ -1746,23 +1709,6 @@ public void testBlobConditionalAccess() throws StorageException, IOException, UR
17461709
newETag = blob.getProperties().getEtag();
17471710
assertFalse("ETage should be modified on write metadata", newETag.equals(currentETag));
17481711
}
1749-
1750-
@Test
1751-
public void testBlobExceedMaxRange() throws URISyntaxException, StorageException, IOException
1752-
{
1753-
CloudBlockBlob blob = container.getBlockBlobReference("blockblob4");
1754-
blob.deleteIfExists();
1755-
1756-
byte[] msg = "my message".getBytes("UTF-8");
1757-
blob.uploadFromByteArray(msg, 0, msg.length);
1758-
1759-
byte[] buffer = new byte[msg.length + 5];
1760-
1761-
blob.downloadRangeToByteArray(0, (long) buffer.length, buffer, 0, null, null, null);
1762-
String expected = new String (msg, "UTF-8");
1763-
String actual = new String(buffer, "UTF-8").substring(0, 10);
1764-
assertEquals(expected, actual);
1765-
}
17661712

17671713
@Test
17681714
@Category({ DevFabricTests.class, DevStoreTests.class })

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

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -211,32 +211,6 @@ public void testPageBlobDownloadRangeValidationTest() throws StorageException, U
211211
assertEquals(100, downloadLength);
212212
}
213213

214-
/**
215-
* Test requesting stored content MD5 with OpenWriteExisting().
216-
*
217-
* @throws URISyntaxException
218-
* @throws StorageException
219-
*/
220-
@Test
221-
public void testPageOpenWriteExistingWithMD5() throws URISyntaxException, StorageException, IOException {
222-
final String pageBlobName = BlobTestHelper.generateRandomBlobNameWithPrefix("testPageBlob");
223-
final CloudPageBlob pageBlobRef = this.container.getPageBlobReference(pageBlobName);
224-
pageBlobRef.create(512);
225-
226-
BlobRequestOptions options = new BlobRequestOptions();
227-
options.setStoreBlobContentMD5(true);
228-
options.setDisableContentMD5Validation(false);
229-
230-
try
231-
{
232-
pageBlobRef.openWriteExisting(null, options, null);
233-
fail("Expect failure due to requesting MD5 calculation");
234-
}
235-
catch (IllegalArgumentException e)
236-
{
237-
}
238-
}
239-
240214
@Test
241215
public void testPageBlobUploadFromStreamTest() throws URISyntaxException, StorageException, IOException {
242216
final String pageBlobName = BlobTestHelper.generateRandomBlobNameWithPrefix("testPageBlob");

0 commit comments

Comments
 (0)