Permalink
Browse files

Merge pull request #151 from WindowsAzure/dev

Dev
  • Loading branch information...
2 parents 815058a + be59df0 commit da5d5383b773c6b97f964e282db41fa595af7bc9 @joostdenijs joostdenijs committed Sep 19, 2012
Showing with 1,242 additions and 407 deletions.
  1. +11 −0 ChangeLog.txt
  2. +52 −55 README.md
  3. +11 −1 microsoft-azure-api/pom.xml
  4. +11 −8 microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/blob/BlobContract.java
  5. +39 −3 ...osoft-azure-api/src/main/java/com/microsoft/windowsazure/services/blob/client/BlobAttributes.java
  6. +21 −11 ...re-api/src/main/java/com/microsoft/windowsazure/services/blob/client/BlobContainerProperties.java
  7. +63 −31 ...osoft-azure-api/src/main/java/com/microsoft/windowsazure/services/blob/client/BlobProperties.java
  8. +35 −29 microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/blob/client/CloudBlob.java
  9. +59 −48 ...t-azure-api/src/main/java/com/microsoft/windowsazure/services/blob/client/CloudBlobContainer.java
  10. +75 −2 microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/blob/client/CopyState.java
  11. +1 −1 microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/blob/client/CopyStatus.java
  12. +1 −1 ...pi/src/main/java/com/microsoft/windowsazure/services/blob/client/SharedAccessBlobPermissions.java
  13. +21 −7 ...ure-api/src/main/java/com/microsoft/windowsazure/services/blob/client/SharedAccessBlobPolicy.java
  14. +25 −22 ...src/main/java/com/microsoft/windowsazure/services/blob/implementation/BlobExceptionProcessor.java
  15. +126 −58 ...zure-api/src/main/java/com/microsoft/windowsazure/services/blob/implementation/BlobRestProxy.java
  16. +80 −0 ...osoft-azure-api/src/main/java/com/microsoft/windowsazure/services/blob/models/CopyBlobResult.java
  17. +80 −0 ...oft-azure-api/src/main/java/com/microsoft/windowsazure/services/blob/models/CreateBlobResult.java
  18. +4 −3 ...ft-azure-api/src/main/java/com/microsoft/windowsazure/services/blob/models/DeleteBlobOptions.java
  19. +2 −2 ...osoft-azure-api/src/main/java/com/microsoft/windowsazure/services/core/storage/LeaseDuration.java
  20. +2 −2 microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/core/storage/LeaseState.java
  21. +6 −2 ...re-api/src/main/java/com/microsoft/windowsazure/services/core/utils/pipeline/PipelineHelpers.java
  22. +4 −1 microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/queue/client/CloudQueue.java
  23. +9 −6 ...ft-azure-api/src/main/java/com/microsoft/windowsazure/services/queue/client/QueuePermissions.java
  24. +1 −1 .../src/main/java/com/microsoft/windowsazure/services/queue/client/SharedAccessQueuePermissions.java
  25. +23 −9 ...e-api/src/main/java/com/microsoft/windowsazure/services/queue/client/SharedAccessQueuePolicy.java
  26. +21 −18 ...ure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/ServiceBusConfiguration.java
  27. +12 −8 ...c/main/java/com/microsoft/windowsazure/services/serviceBus/implementation/EntryModelProvider.java
  28. +12 −8 ...a/com/microsoft/windowsazure/services/serviceBus/implementation/ServiceBusExceptionProcessor.java
  29. +8 −8 .../main/java/com/microsoft/windowsazure/services/serviceBus/implementation/ServiceBusRestProxy.java
  30. +18 −15 microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/table/client/CloudTable.java
  31. +1 −1 .../src/main/java/com/microsoft/windowsazure/services/table/client/SharedAccessTablePermissions.java
  32. +22 −8 ...e-api/src/main/java/com/microsoft/windowsazure/services/table/client/SharedAccessTablePolicy.java
  33. +6 −2 ...ft-azure-api/src/main/java/com/microsoft/windowsazure/services/table/client/TablePermissions.java
  34. +22 −0 ...-api/src/main/java/com/microsoft/windowsazure/services/table/implementation/AtomReaderWriter.java
  35. +204 −8 ...-azure-api/src/test/java/com/microsoft/windowsazure/services/blob/BlobServiceIntegrationTest.java
  36. +42 −0 ...pi/src/test/java/com/microsoft/windowsazure/services/core/utils/pipeline/PipelineHelpersTest.java
  37. +12 −10 ...api/src/test/java/com/microsoft/windowsazure/services/serviceBus/ServiceBusConfigurationTest.java
  38. +12 −10 ...zure-api/src/test/java/com/microsoft/windowsazure/services/serviceBus/ServiceBusCreationTest.java
  39. +34 −8 ...e-api/src/test/java/com/microsoft/windowsazure/services/serviceBus/ServiceBusIntegrationTest.java
  40. +54 −0 ...zure-api/src/test/java/com/microsoft/windowsazure/services/table/TableServiceIntegrationTest.java
View
@@ -1,3 +1,14 @@
+2012.09.11 Version 0.3.1
+ * Added Javadocs to 1.7 Storage Support from 0.3.0 release
+ * Fixed bug where getqueue for an invalid queue returns 200 and the exception is not wrapped in a ServiceException
+ * Fixed the error when deleting a blob snapshot in the Service Layer
+ * Changed the PageBlob length parameter from an int to a long
+ * Return an Etag for create and copy Blob in Service Layer
+ * Updated the BlobRestProxy.copyBlob to correctly honor source access conditions
+ * Updated the BlobRestProxy.getBlob to correctly honor setComputeRangeMD5 option
+ * Added international support for ServiceBus URIs
+ * Added encoding for special characters when serializing entity to XML in Table Service Layer
+
2012.06.02 Version 0.3.0
* Added 1.7 Storage Support
* Added Javadocs for com.microsoft.windowsazure.services.table
View
107 README.md
@@ -38,13 +38,11 @@ To get the source code of the SDK via git just type:
To get the binaries of this library as distributed by Microsoft, ready for use
within your project you can also have them installed by the Java package manager Maven.
-```xml
-<dependency>
- <groupId>com.microsoft.windowsazure</groupId>
- <artifactId>microsoft-windowsazure-api</artifactId>
- <version>0.3.0</version>
-</dependency>
-```
+ <dependency>
+ <groupId>com.microsoft.windowsazure</groupId>
+ <artifactId>microsoft-windowsazure-api</artifactId>
+ <version>0.3.1</version>
+ </dependency>
##Minimum Requirements
@@ -64,63 +62,62 @@ deployment tools.
The following is a quick example on how to set up a Azure blob using the API
and uploading a file to it. For additional information on using the client libraries to access Azure services see the How To guides listed [here](http://www.windowsazure.com/en-us/develop/java/).
-```java
-import com.microsoft.windowsazure.services.core.storage.*;
-import com.microsoft.windowsazure.services.blob.client.*;
-public class BlobSample {
+ import com.microsoft.windowsazure.services.core.storage.*;
+ import com.microsoft.windowsazure.services.blob.client.*;
- public static final String storageConnectionString =
+ public class BlobSample {
+ public static final String storageConnectionString =
"DefaultEndpointsProtocol=http;" +
"AccountName=your_account_name;" +
"AccountKey= your_account_name";
- public static void main(String[] args)
- {
- try
- {
- CloudStorageAccount account;
- CloudBlobClient serviceClient;
- CloudBlobContainer container;
- CloudBlockBlob blob;
+ public static void main(String[] args)
+ {
+ try
+ {
+ CloudStorageAccount account;
+ CloudBlobClient serviceClient;
+ CloudBlobContainer container;
+ CloudBlockBlob blob;
- account = CloudStorageAccount.parse(storageConnectionString);
- serviceClient = account.createCloudBlobClient();
- // Container name must be lower case.
- container = serviceClient.getContainerReference("blobsample");
- container.createIfNotExist();
+ account = CloudStorageAccount.parse(storageConnectionString);
+ serviceClient = account.createCloudBlobClient();
+ // Container name must be lower case.
+ container = serviceClient.getContainerReference("blobsample");
+ container.createIfNotExist();
- // Set anonymous access on the container.
- BlobContainerPermissions containerPermissions;
- containerPermissions = new BlobContainerPermissions();
-
- // Upload an image file.
- blob = container.getBlockBlobReference("image1.jpg");
- File fileReference = new File ("c:\\myimages\\image1.jpg");
- blob.upload(new FileInputStream(fileReference), fileReference.length());
- }
- catch (FileNotFoundException fileNotFoundException)
- {
- System.out.print("FileNotFoundException encountered: ");
- System.out.println(fileNotFoundException.getMessage());
- System.exit(-1);
- }
- catch (StorageException storageException)
- {
- System.out.print("StorageException encountered: ");
- System.out.println(storageException.getMessage());
- System.exit(-1);
- }
- catch (Exception e)
- {
- System.out.print("Exception encountered: ");
- System.out.println(e.getMessage());
- System.exit(-1);
- }
+ // Set anonymous access on the container.
+ BlobContainerPermissions containerPermissions;
+ containerPermissions = new BlobContainerPermissions();
+
+ // Upload an image file.
+ blob = container.getBlockBlobReference("image1.jpg");
+ File fileReference = new File ("c:\\myimages\\image1.jpg");
+ blob.upload(new FileInputStream(fileReference), fileReference.length());
+ }
+ catch (FileNotFoundException fileNotFoundException)
+ {
+ System.out.print("FileNotFoundException encountered: ");
+ System.out.println(fileNotFoundException.getMessage());
+ System.exit(-1);
+ }
+ catch (StorageException storageException)
+ {
+ System.out.print("StorageException encountered: ");
+ System.out.println(storageException.getMessage());
+ System.exit(-1);
+ }
+ catch (Exception e)
+ {
+ System.out.print("Exception encountered: ");
+ System.out.println(e.getMessage());
+ System.exit(-1);
+ }
- }
-}
-```
+ }
+ }
+
#Need Help?
@@ -17,7 +17,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.microsoft.windowsazure</groupId>
<artifactId>microsoft-windowsazure-api</artifactId>
- <version>0.3.0</version>
+ <version>0.3.1</version>
<packaging>jar</packaging>
<name>Microsoft Windows Azure Client API</name>
@@ -236,6 +236,16 @@
</lifecycleMappingMetadata>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>2.4.3</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.12</version>
+ </plugin>
</plugins>
</pluginManagement>
</build>
@@ -24,10 +24,12 @@
import com.microsoft.windowsazure.services.blob.models.CommitBlobBlocksOptions;
import com.microsoft.windowsazure.services.blob.models.ContainerACL;
import com.microsoft.windowsazure.services.blob.models.CopyBlobOptions;
+import com.microsoft.windowsazure.services.blob.models.CopyBlobResult;
import com.microsoft.windowsazure.services.blob.models.CreateBlobBlockOptions;
import com.microsoft.windowsazure.services.blob.models.CreateBlobOptions;
import com.microsoft.windowsazure.services.blob.models.CreateBlobPagesOptions;
import com.microsoft.windowsazure.services.blob.models.CreateBlobPagesResult;
+import com.microsoft.windowsazure.services.blob.models.CreateBlobResult;
import com.microsoft.windowsazure.services.blob.models.CreateBlobSnapshotOptions;
import com.microsoft.windowsazure.services.blob.models.CreateBlobSnapshotResult;
import com.microsoft.windowsazure.services.blob.models.CreateContainerOptions;
@@ -429,7 +431,7 @@ void setContainerMetadata(String container, HashMap<String, String> metadata, Se
* @throws ServiceException
* if an error occurs accessing the storage service.
*/
- void createPageBlob(String container, String blob, int length) throws ServiceException;
+ CreateBlobResult createPageBlob(String container, String blob, long length) throws ServiceException;
/**
* Creates a page blob of the specified maximum length, using the specified options.
@@ -457,7 +459,8 @@ void setContainerMetadata(String container, HashMap<String, String> metadata, Se
* @throws ServiceException
* if an error occurs accessing the storage service.
*/
- void createPageBlob(String container, String blob, int length, CreateBlobOptions options) throws ServiceException;
+ CreateBlobResult createPageBlob(String container, String blob, long length, CreateBlobOptions options)
+ throws ServiceException;
/**
* Creates a block blob from a content stream.
@@ -473,7 +476,7 @@ void setContainerMetadata(String container, HashMap<String, String> metadata, Se
* @throws ServiceException
* if an error occurs accessing the storage service.
*/
- void createBlockBlob(String container, String blob, InputStream contentStream) throws ServiceException;
+ CreateBlobResult createBlockBlob(String container, String blob, InputStream contentStream) throws ServiceException;
/**
* Creates a block blob from a content stream, using the specified options.
@@ -495,7 +498,7 @@ void setContainerMetadata(String container, HashMap<String, String> metadata, Se
* @throws ServiceException
* if an error occurs accessing the storage service.
*/
- void createBlockBlob(String container, String blob, InputStream contentStream, CreateBlobOptions options)
+ CreateBlobResult createBlockBlob(String container, String blob, InputStream contentStream, CreateBlobOptions options)
throws ServiceException;
/**
@@ -1214,8 +1217,8 @@ CreateBlobSnapshotResult createBlobSnapshot(String container, String blob, Creat
* @throws ServiceException
* if an error occurs accessing the storage service.
*/
- void copyBlob(String destinationContainer, String destinationBlob, String sourceContainer, String sourceBlob)
- throws ServiceException;
+ CopyBlobResult copyBlob(String destinationContainer, String destinationBlob, String sourceContainer,
+ String sourceBlob) throws ServiceException;
/**
* Copies a source blob to a destination within the storage account, using the specified options.
@@ -1293,8 +1296,8 @@ void copyBlob(String destinationContainer, String destinationBlob, String source
* @throws ServiceException
* if an error occurs accessing the storage service.
*/
- void copyBlob(String destinationContainer, String destinationBlob, String sourceContainer, String sourceBlob,
- CopyBlobOptions options) throws ServiceException;
+ CopyBlobResult copyBlob(String destinationContainer, String destinationBlob, String sourceContainer,
+ String sourceBlob, CopyBlobOptions options) throws ServiceException;
/**
* Gets a new lease on a blob.
@@ -44,38 +44,74 @@
public String snapshotID;
/**
- * Holds the URI of the blob, Setting this is RESERVED for internal use.
+ * Holds the URI of the blob. RESERVED for internal use.
*/
protected URI uri;
- /**
- * Initializes a new instance of the BlobAttributes class
+ /**
+ * Initializes a new instance of the BlobAttributes class. RESERVED FOR INTERNAL USE.
+ *
+ * @param type
+ * The type of blob to set.
*/
public BlobAttributes(final BlobType type) {
this.setMetadata(new HashMap<String, String>());
this.setProperties(new BlobProperties(type));
}
+ /**
+ * Gets the metadata for the blob. RESERVED FOR INTERNAL USE.
+ *
+ * @return A <code>HashMap</code> object containing the metadata for the blob.
+ */
public HashMap<String, String> getMetadata() {
return this.metadata;
}
+ /**
+ * Gets the copy state of the blob. RESERVED FOR INTERNAL USE.
+ *
+ * @return A <code>CopyState</code> object representing the copy state.
+ */
public CopyState getCopyState() {
return this.copyState;
}
+ /**
+ * Gets the properties for the blob. RESERVED FOR INTERNAL USE.
+ *
+ * @return A <code>BlobProperties</code> object that represents the blob properties.
+ */
public BlobProperties getProperties() {
return this.properties;
}
+ /**
+ * Sets the metadata for a blob. RESERVED FOR INTERNAL USE.
+ *
+ * @param metadata
+ * The blob meta data to set.
+ */
protected void setMetadata(final HashMap<String, String> metadata) {
this.metadata = metadata;
}
+ /**
+ * Sets the properties for a blob. RESERVED FOR INTERNAL USE.
+ *
+ * @param properties
+ * The blob properties to set.
+ */
protected void setProperties(final BlobProperties properties) {
this.properties = properties;
}
+ /**
+ * Sets the copy state for a blob. RESERVED FOR INTERNAL USE.
+ *
+ * @param copyState
+ * The blob copy state to set.
+ */
public void setCopyState(final CopyState copyState) {
this.copyState = copyState;
}
Oops, something went wrong.

0 comments on commit da5d538

Please sign in to comment.