From 3e422edc43df4ee067ea30199584b48743245730 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Wed, 6 Mar 2013 10:22:47 -0800 Subject: [PATCH 01/12] fix for issue 188, broker properties mapper --- .../serviceBus/implementation/BrokerPropertiesMapper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/implementation/BrokerPropertiesMapper.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/implementation/BrokerPropertiesMapper.java index a01aa2aed43b..eefbae626684 100644 --- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/implementation/BrokerPropertiesMapper.java +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/implementation/BrokerPropertiesMapper.java @@ -28,7 +28,7 @@ public class BrokerPropertiesMapper { public BrokerProperties fromString(String value) throws IllegalArgumentException { ObjectMapper mapper = new ObjectMapper(); try { - return mapper.readValue(value.getBytes(), BrokerProperties.class); + return mapper.readValue(value.getBytes("UTF-8"), BrokerProperties.class); } catch (JsonParseException e) { throw new IllegalArgumentException(e); From 32b0c8be339fd2c2bfe1012ec107e5104d8b0939 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Wed, 6 Mar 2013 10:29:13 -0800 Subject: [PATCH 02/12] fix for issue 189, unicode issues in BrokeredMessage --- .../services/serviceBus/models/BrokeredMessage.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/models/BrokeredMessage.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/models/BrokeredMessage.java index a2518f45afd9..3c222a52e793 100644 --- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/models/BrokeredMessage.java +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/models/BrokeredMessage.java @@ -16,6 +16,7 @@ import java.io.ByteArrayInputStream; import java.io.InputStream; +import java.io.UnsupportedEncodingException; import java.util.Date; import java.util.HashMap; import java.util.Map; @@ -70,7 +71,12 @@ public BrokeredMessage(byte[] body) { */ public BrokeredMessage(String body) { this(new BrokerProperties()); - this.body = (body == null) ? null : new ByteArrayInputStream(body.getBytes()); + try { + this.body = (body == null) ? null : new ByteArrayInputStream(body.getBytes("UTF-8")); + } + catch (UnsupportedEncodingException e) { + throw new RuntimeException(e); + } } /** From 7595d281c8a84dc1ded5121887f4ab04a3b7c1d9 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Wed, 6 Mar 2013 10:52:13 -0800 Subject: [PATCH 03/12] fix for issue 191, unicode issues in BlobOperationRestProxy.java --- .../implementation/BlobOperationRestProxy.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/blob/implementation/BlobOperationRestProxy.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/blob/implementation/BlobOperationRestProxy.java index 24adf87f4a23..5b865241508f 100644 --- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/blob/implementation/BlobOperationRestProxy.java +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/blob/implementation/BlobOperationRestProxy.java @@ -16,6 +16,7 @@ package com.microsoft.windowsazure.services.blob.implementation; import java.io.InputStream; +import java.io.UnsupportedEncodingException; import java.util.HashMap; import java.util.Map; @@ -808,7 +809,8 @@ public void breakLease(String container, String blob, String leaseId) throws Ser @Override @Deprecated - public void breakLease(String container, String blob, String leaseId, BlobServiceOptions options) throws ServiceException { + public void breakLease(String container, String blob, String leaseId, BlobServiceOptions options) + throws ServiceException { breakLease(container, blob, options); } @@ -819,8 +821,8 @@ public BreakLeaseResult breakLease(String container, String blob) throws Service @Override public BreakLeaseResult breakLease(String container, String blob, BlobServiceOptions options) - throws ServiceException { - ClientResponse response = doLeaseOperation("break", container, blob, null, options, null); + throws ServiceException { + ClientResponse response = doLeaseOperation("break", container, blob, null, options, null); BreakLeaseResult result = new BreakLeaseResult(); result.setRemainingLeaseTimeInSeconds(Integer.parseInt(response.getHeaders().getFirst("x-ms-lease-time"))); @@ -836,7 +838,8 @@ private AcquireLeaseResult putLeaseImpl(String leaseAction, String container, St return result; } - private ClientResponse doLeaseOperation(String leaseAction, String container, String blob, String leaseId, BlobServiceOptions options, AccessCondition accessCondition) { + private ClientResponse doLeaseOperation(String leaseAction, String container, String blob, String leaseId, + BlobServiceOptions options, AccessCondition accessCondition) { String path = createPathFromContainer(container); WebResource webResource = getResource(options).path(path).path(blob).queryParam("comp", "lease"); @@ -941,7 +944,12 @@ public void createBlobBlock(String container, String blob, String blockId, Input CreateBlobBlockOptions options) throws ServiceException { String path = createPathFromContainer(container); WebResource webResource = getResource(options).path(path).path(blob).queryParam("comp", "block"); - webResource = addOptionalQueryParam(webResource, "blockid", new String(Base64.encode(blockId))); + try { + webResource = addOptionalQueryParam(webResource, "blockid", new String(Base64.encode(blockId), "UTF-8")); + } + catch (UnsupportedEncodingException e) { + throw new RuntimeException(e); + } Builder builder = webResource.header("x-ms-version", API_VERSION); builder = addOptionalHeader(builder, "x-ms-lease-id", options.getLeaseId()); From dbff29a150ea6f682ea713873f40eff3b6511883 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Wed, 6 Mar 2013 17:15:21 -0800 Subject: [PATCH 04/12] update the unicode issues in HmacSHA256Sign file, issue 192#. --- .../blob/implementation/HmacSHA256Sign.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/blob/implementation/HmacSHA256Sign.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/blob/implementation/HmacSHA256Sign.java index 71a68bd061cc..e40607c67522 100644 --- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/blob/implementation/HmacSHA256Sign.java +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/blob/implementation/HmacSHA256Sign.java @@ -2,15 +2,15 @@ * Copyright Microsoft Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.microsoft.windowsazure.services.blob.implementation; @@ -33,8 +33,8 @@ public String sign(String stringToSign) { Mac hmac = Mac.getInstance("hmacSHA256"); hmac.init(new SecretKeySpec(Base64.decode(accessKey), "hmacSHA256")); - byte[] digest = hmac.doFinal(stringToSign.getBytes("UTF8")); - return new String(Base64.encode(digest)); + byte[] digest = hmac.doFinal(stringToSign.getBytes("UTF-8")); + return new String(Base64.encode(digest), "UTF-8"); } catch (Exception e) { throw new IllegalArgumentException("accessKey", e); From 3ff10d54740284ef88f77028a1b874f18dc0917f Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Wed, 6 Mar 2013 17:33:01 -0800 Subject: [PATCH 05/12] fix base64 string adapter encoding issue, issue #193. --- .../utils/pipeline/Base64StringAdapter.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/core/utils/pipeline/Base64StringAdapter.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/core/utils/pipeline/Base64StringAdapter.java index 975bc675e4bb..f9aedb2faf94 100644 --- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/core/utils/pipeline/Base64StringAdapter.java +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/core/utils/pipeline/Base64StringAdapter.java @@ -2,15 +2,15 @@ * Copyright Microsoft Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.microsoft.windowsazure.services.core.utils.pipeline; @@ -25,7 +25,7 @@ public class Base64StringAdapter extends XmlAdapter { @Override public String marshal(String arg0) throws Exception { - return new String(Base64.encode(arg0)); + return new String(Base64.encode(arg0), "UTF-8"); } @Override From 225aa9aef3aca18a9af284a8eabb825fa0c69d7b Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Wed, 6 Mar 2013 17:40:54 -0800 Subject: [PATCH 06/12] fix issue #194, unicode issue in DefaultEdmValueConverter.java --- .../windowsazure/services/table/Exports.java | 4 +- .../DefaultEdmValueConterter.java | 90 ------------------- .../implementation/AtomReaderWriterTests.java | 2 +- 3 files changed, 3 insertions(+), 93 deletions(-) delete mode 100644 microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/table/implementation/DefaultEdmValueConterter.java diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/table/Exports.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/table/Exports.java index 485104a66a29..6be3e3c25264 100644 --- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/table/Exports.java +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/table/Exports.java @@ -17,7 +17,7 @@ import com.microsoft.windowsazure.services.core.Builder; import com.microsoft.windowsazure.services.core.UserAgentFilter; import com.microsoft.windowsazure.services.table.implementation.AtomReaderWriter; -import com.microsoft.windowsazure.services.table.implementation.DefaultEdmValueConterter; +import com.microsoft.windowsazure.services.table.implementation.DefaultEdmValueConverter; import com.microsoft.windowsazure.services.table.implementation.DefaultXMLStreamFactory; import com.microsoft.windowsazure.services.table.implementation.HttpReaderWriter; import com.microsoft.windowsazure.services.table.implementation.MimeReaderWriter; @@ -39,7 +39,7 @@ public void register(Builder.Registry registry) { registry.add(AtomReaderWriter.class); registry.add(MimeReaderWriter.class); registry.add(HttpReaderWriter.class); - registry.add(EdmValueConverter.class, DefaultEdmValueConterter.class); + registry.add(EdmValueConverter.class, DefaultEdmValueConverter.class); registry.add(UserAgentFilter.class); } } diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/table/implementation/DefaultEdmValueConterter.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/table/implementation/DefaultEdmValueConterter.java deleted file mode 100644 index 8d1aff2334cb..000000000000 --- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/table/implementation/DefaultEdmValueConterter.java +++ /dev/null @@ -1,90 +0,0 @@ -/** - * Copyright Microsoft Corporation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.microsoft.windowsazure.services.table.implementation; - -import java.text.ParseException; -import java.util.Date; -import java.util.UUID; - -import javax.inject.Inject; - -import com.microsoft.windowsazure.services.blob.implementation.ISO8601DateConverter; -import com.microsoft.windowsazure.services.table.EdmValueConverter; -import com.microsoft.windowsazure.services.table.models.EdmType; -import com.sun.jersey.core.util.Base64; - -public class DefaultEdmValueConterter implements EdmValueConverter { - - private final ISO8601DateConverter iso8601DateConverter; - - @Inject - public DefaultEdmValueConterter(ISO8601DateConverter iso8601DateConverter) { - this.iso8601DateConverter = iso8601DateConverter; - } - - @Override - public String serialize(String edmType, Object value) { - if (value == null) - return null; - - String serializedValue; - if (value instanceof Date) { - serializedValue = iso8601DateConverter.format((Date) value); - } - else if (value instanceof byte[]) { - serializedValue = new String(Base64.encode((byte[]) value)); - } - else { - serializedValue = value.toString(); - } - - return serializedValue; - } - - @Override - public Object deserialize(String edmType, String value) { - if (edmType == null) - return value; - - if (EdmType.DATETIME.equals(edmType)) { - try { - return iso8601DateConverter.parse(value); - } - catch (ParseException e) { - throw new RuntimeException(e); - } - } - else if (EdmType.BOOLEAN.equals(edmType)) { - return Boolean.parseBoolean(value); - } - else if (EdmType.DOUBLE.equals(edmType)) { - return Double.parseDouble(value); - } - else if (EdmType.INT32.equals(edmType)) { - return Integer.parseInt(value); - } - else if (EdmType.INT64.equals(edmType)) { - return Long.parseLong(value); - } - else if (EdmType.BINARY.equals(edmType)) { - return Base64.decode(value); - } - else if (EdmType.GUID.equals(edmType)) { - return UUID.fromString(value); - } - - return value; - } -} diff --git a/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/table/implementation/AtomReaderWriterTests.java b/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/table/implementation/AtomReaderWriterTests.java index 17578984f68c..1a2fd1ef0895 100644 --- a/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/table/implementation/AtomReaderWriterTests.java +++ b/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/table/implementation/AtomReaderWriterTests.java @@ -32,7 +32,7 @@ public class AtomReaderWriterTests extends IntegrationTestBase { public void parseTableEntriesWorks() throws Exception { // Arrange AtomReaderWriter atom = new AtomReaderWriter(new DefaultXMLStreamFactory(), new DefaultDateFactory(), - new ISO8601DateConverter(), new DefaultEdmValueConterter(new ISO8601DateConverter())); + new ISO8601DateConverter(), new DefaultEdmValueConverter(new ISO8601DateConverter())); String feed = "\r\n" + "\r\n" + " Tables\r\n" From 0ecdd94a252532b6b0b4518244b0444812ce9317 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Wed, 6 Mar 2013 17:41:47 -0800 Subject: [PATCH 07/12] add the missing DefaultEdmValueConverter.java file --- .../DefaultEdmValueConverter.java | 90 +++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/table/implementation/DefaultEdmValueConverter.java diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/table/implementation/DefaultEdmValueConverter.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/table/implementation/DefaultEdmValueConverter.java new file mode 100644 index 000000000000..cdf08312d8ae --- /dev/null +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/table/implementation/DefaultEdmValueConverter.java @@ -0,0 +1,90 @@ +/** + * Copyright Microsoft Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.microsoft.windowsazure.services.table.implementation; + +import java.text.ParseException; +import java.util.Date; +import java.util.UUID; + +import javax.inject.Inject; + +import com.microsoft.windowsazure.services.blob.implementation.ISO8601DateConverter; +import com.microsoft.windowsazure.services.table.EdmValueConverter; +import com.microsoft.windowsazure.services.table.models.EdmType; +import com.sun.jersey.core.util.Base64; + +public class DefaultEdmValueConverter implements EdmValueConverter { + + private final ISO8601DateConverter iso8601DateConverter; + + @Inject + public DefaultEdmValueConverter(ISO8601DateConverter iso8601DateConverter) { + this.iso8601DateConverter = iso8601DateConverter; + } + + @Override + public String serialize(String edmType, Object value) { + if (value == null) + return null; + + String serializedValue; + if (value instanceof Date) { + serializedValue = iso8601DateConverter.format((Date) value); + } + else if (value instanceof byte[]) { + serializedValue = new String(Base64.encode((byte[]) value)); + } + else { + serializedValue = value.toString(); + } + + return serializedValue; + } + + @Override + public Object deserialize(String edmType, String value) { + if (edmType == null) + return value; + + if (EdmType.DATETIME.equals(edmType)) { + try { + return iso8601DateConverter.parse(value); + } + catch (ParseException e) { + throw new RuntimeException(e); + } + } + else if (EdmType.BOOLEAN.equals(edmType)) { + return Boolean.parseBoolean(value); + } + else if (EdmType.DOUBLE.equals(edmType)) { + return Double.parseDouble(value); + } + else if (EdmType.INT32.equals(edmType)) { + return Integer.parseInt(value); + } + else if (EdmType.INT64.equals(edmType)) { + return Long.parseLong(value); + } + else if (EdmType.BINARY.equals(edmType)) { + return Base64.decode(value); + } + else if (EdmType.GUID.equals(edmType)) { + return UUID.fromString(value); + } + + return value; + } +} From be09f31fe097b71b274186fcd879eed0dab113cf Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Mon, 11 Mar 2013 16:52:32 -0700 Subject: [PATCH 08/12] throw exception when you create or update null message. --- .../ChunkedGoalStateDeserializer.java | 16 +++--- .../XmlGoalStateDeserializer.java | 16 +++--- .../queue/implementation/QueueRestProxy.java | 14 ++++-- .../queue/QueueServiceIntegrationTest.java | 49 ++++++++++++++++--- 4 files changed, 67 insertions(+), 28 deletions(-) diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/serviceruntime/ChunkedGoalStateDeserializer.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/serviceruntime/ChunkedGoalStateDeserializer.java index 38ed6c4a4812..9d592a94327d 100644 --- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/serviceruntime/ChunkedGoalStateDeserializer.java +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/serviceruntime/ChunkedGoalStateDeserializer.java @@ -2,15 +2,15 @@ * Copyright Microsoft Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.microsoft.windowsazure.serviceruntime; diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/serviceruntime/XmlGoalStateDeserializer.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/serviceruntime/XmlGoalStateDeserializer.java index 700e9e33d186..688e5dfc6ef5 100644 --- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/serviceruntime/XmlGoalStateDeserializer.java +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/serviceruntime/XmlGoalStateDeserializer.java @@ -2,15 +2,15 @@ * Copyright Microsoft Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.microsoft.windowsazure.serviceruntime; diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/queue/implementation/QueueRestProxy.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/queue/implementation/QueueRestProxy.java index 5f3c663c37db..454f51e44c9d 100644 --- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/queue/implementation/QueueRestProxy.java +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/queue/implementation/QueueRestProxy.java @@ -87,7 +87,8 @@ public QueueRestProxy(HttpURLConnectionClient channel, ServiceFilter[] filters, public QueueContract withFilter(ServiceFilter filter) { ServiceFilter[] newFilters = Arrays.copyOf(filters, filters.length + 1); newFilters[filters.length] = filter; - return new QueueRestProxy(this.channel, newFilters, this.accountName, this.url, this.sharedKeyFilter, this.dateMapper); + return new QueueRestProxy(this.channel, newFilters, this.accountName, this.url, this.sharedKeyFilter, + this.dateMapper); } private void ThrowIfError(ClientResponse r) { @@ -261,7 +262,10 @@ public void createMessage(String queue, String messageText) throws ServiceExcept @Override public void createMessage(String queue, String messageText, CreateMessageOptions options) throws ServiceException { if (queue == null) - throw new NullPointerException(); + throw new NullPointerException("queue"); + if (messageText == null) { + throw new NullPointerException("messageText"); + } WebResource webResource = getResource(options).path(queue).path("messages"); webResource = addOptionalQueryParam(webResource, "visibilitytimeout", options.getVisibilityTimeoutInSeconds()); @@ -286,9 +290,11 @@ public UpdateMessageResult updateMessage(String queue, String messageId, String public UpdateMessageResult updateMessage(String queue, String messageId, String popReceipt, String messageText, int visibilityTimeoutInSeconds, QueueServiceOptions options) throws ServiceException { if (queue == null) - throw new NullPointerException(); + throw new NullPointerException("queue"); if (messageId == null) - throw new NullPointerException(); + throw new NullPointerException("messageId"); + if (messageText == null) + throw new NullPointerException("messageText"); WebResource webResource = getResource(options).path(queue).path("messages").path(messageId); webResource = addOptionalQueryParam(webResource, "popreceipt", popReceipt); diff --git a/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/queue/QueueServiceIntegrationTest.java b/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/queue/QueueServiceIntegrationTest.java index 0380a7be8942..ecfeb03a0259 100644 --- a/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/queue/QueueServiceIntegrationTest.java +++ b/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/queue/QueueServiceIntegrationTest.java @@ -2,15 +2,15 @@ * Copyright Microsoft Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.microsoft.windowsazure.services.queue; @@ -25,7 +25,9 @@ import org.junit.AfterClass; import org.junit.BeforeClass; +import org.junit.Rule; import org.junit.Test; +import org.junit.rules.ExpectedException; import com.microsoft.windowsazure.services.core.Configuration; import com.microsoft.windowsazure.services.queue.models.CreateQueueOptions; @@ -58,6 +60,9 @@ public class QueueServiceIntegrationTest extends IntegrationTestBase { private static String[] creatableQueues; private static String[] testQueues; + @Rule + public ExpectedException expectedException = ExpectedException.none(); + @BeforeClass public static void setup() throws Exception { // Setup container names array (list of container names used by @@ -315,6 +320,17 @@ public void createMessageWorks() throws Exception { // Assert } + @Test + public void createNullMessageException() throws Exception { + // Arrange + Configuration config = createConfiguration(); + QueueContract service = QueueService.create(config); + + // Act + expectedException.expect(NullPointerException.class); + service.createMessage(TEST_QUEUE_FOR_MESSAGES, null); + } + @Test public void listMessagesWorks() throws Exception { // Arrange @@ -508,6 +524,23 @@ public void deleteMessageWorks() throws Exception { assertEquals(3, result2.getQueueMessages().size()); } + @Test + public void updateNullMessageException() throws Exception { + // Arrange + Configuration config = createConfiguration(); + QueueContract service = QueueService.create(config); + String messageId = "messageId"; + + String popReceipt = "popReceipt"; + String messageText = null; + int visibilityTimeoutInSeconds = 10; + + // Act + expectedException.expect(NullPointerException.class); + service.updateMessage(TEST_QUEUE_FOR_MESSAGES_8, messageId, popReceipt, messageText, visibilityTimeoutInSeconds); + + } + @Test public void updateMessageWorks() throws Exception { // Arrange From c8561a20350b5fcb6587714cb212f4c62f92d0a1 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Thu, 21 Mar 2013 17:21:12 -0700 Subject: [PATCH 09/12] fix the global date parsing issue. --- .../BrokerPropertiesMapper.java | 5 + .../BrokerPropertiesMapperTest.java | 118 +++++++++++++----- 2 files changed, 89 insertions(+), 34 deletions(-) diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/implementation/BrokerPropertiesMapper.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/implementation/BrokerPropertiesMapper.java index eefbae626684..3dfa6ea80c5f 100644 --- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/implementation/BrokerPropertiesMapper.java +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/implementation/BrokerPropertiesMapper.java @@ -17,6 +17,8 @@ import java.io.IOException; import java.io.StringWriter; import java.io.Writer; +import java.text.SimpleDateFormat; +import java.util.Locale; import org.codehaus.jackson.JsonGenerationException; import org.codehaus.jackson.JsonParseException; @@ -26,7 +28,10 @@ public class BrokerPropertiesMapper { public BrokerProperties fromString(String value) throws IllegalArgumentException { + ObjectMapper mapper = new ObjectMapper(); + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz", Locale.US); + mapper.setDateFormat(simpleDateFormat); try { return mapper.readValue(value.getBytes("UTF-8"), BrokerProperties.class); } diff --git a/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/serviceBus/BrokerPropertiesMapperTest.java b/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/serviceBus/BrokerPropertiesMapperTest.java index cef5f5f3b42b..ce827d0430ec 100644 --- a/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/serviceBus/BrokerPropertiesMapperTest.java +++ b/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/serviceBus/BrokerPropertiesMapperTest.java @@ -2,15 +2,15 @@ * Copyright Microsoft Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.microsoft.windowsazure.services.serviceBus; @@ -18,14 +18,40 @@ import java.util.Calendar; import java.util.Date; +import java.util.Locale; import java.util.TimeZone; +import org.junit.BeforeClass; import org.junit.Test; import com.microsoft.windowsazure.services.serviceBus.implementation.BrokerProperties; import com.microsoft.windowsazure.services.serviceBus.implementation.BrokerPropertiesMapper; public class BrokerPropertiesMapperTest { + + private final String testBrokerPropertiesString = "{" + "\"CorrelationId\": \"corid\"," + + "\"SessionId\": \"sesid\"," + "\"DeliveryCount\": 5," + + "\"LockedUntilUtc\": \" Fri, 14 Oct 2011 12:34:56 GMT\"," + "\"LockToken\": \"loctok\"," + + "\"MessageId\": \"mesid\"," + "\"Label\": \"lab\"," + "\"ReplyTo\": \"repto\"," + + "\"SequenceNumber\": 7," + "\"TimeToLive\": 8.123," + "\"To\": \"to\"," + + "\"ScheduledEnqueueTimeUtc\": \" Sun, 06 Nov 1994 08:49:37 GMT\"," + + "\"ReplyToSessionId\": \"reptosesid\"," + "\"MessageLocation\": \"mesloc\"," + + "\"LockLocation\": \"locloc\"" + "}"; + + private static Date schedTimeUtc, lockedUntilUtc; + + @BeforeClass + public static void setup() { + Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("GMT")); + calendar.set(1994, 10, 6, 8, 49, 37); + schedTimeUtc = calendar.getTime(); + + Calendar calendar2 = Calendar.getInstance(TimeZone.getTimeZone("GMT")); + calendar2.set(2011, 9, 14, 12, 34, 56); + lockedUntilUtc = calendar2.getTime(); + + } + @Test public void jsonStringMapsToBrokerPropertiesObject() { // Arrange @@ -61,33 +87,8 @@ public void deserializingAllPossibleValues() { // Arrange BrokerPropertiesMapper mapper = new BrokerPropertiesMapper(); - Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("GMT")); - calendar.set(1994, 10, 6, 8, 49, 37); - Date schedTimeUtc = calendar.getTime(); - - Calendar calendar2 = Calendar.getInstance(TimeZone.getTimeZone("GMT")); - calendar2.set(2011, 9, 14, 12, 34, 56); - Date lockedUntilUtc = calendar2.getTime(); - // Act - BrokerProperties properties = mapper.fromString( - "{" + - "\"CorrelationId\": \"corid\"," + - "\"SessionId\": \"sesid\"," + - "\"DeliveryCount\": 5," + - "\"LockedUntilUtc\": \" Fri, 14 Oct 2011 12:34:56 GMT\"," + - "\"LockToken\": \"loctok\"," + - "\"MessageId\": \"mesid\"," + - "\"Label\": \"lab\"," + - "\"ReplyTo\": \"repto\"," + - "\"SequenceNumber\": 7," + - "\"TimeToLive\": 8.123," + - "\"To\": \"to\"," + - "\"ScheduledEnqueueTimeUtc\": \" Sun, 06 Nov 1994 08:49:37 GMT\"," + - "\"ReplyToSessionId\": \"reptosesid\"," + - "\"MessageLocation\": \"mesloc\"," + - "\"LockLocation\": \"locloc\"" + - "}"); + BrokerProperties properties = mapper.fromString(testBrokerPropertiesString); // Assert assertNotNull(properties); @@ -124,4 +125,53 @@ public void missingDatesDeserializeAsNull() { assertNull(properties.getLockedUntilUtc()); assertNull(properties.getScheduledEnqueueTimeUtc()); } + + @Test + public void deserializeDateInKrKrLocaleCorrectly() { + // Arrange + BrokerPropertiesMapper mapper = new BrokerPropertiesMapper(); + Locale defaultLocale = Locale.getDefault(); + Locale.setDefault(Locale.KOREA); + + // Act + BrokerProperties brokerProperties = mapper.fromString(testBrokerPropertiesString); + Locale.setDefault(defaultLocale); + + // Assert + long lockedUntilDelta = brokerProperties.getLockedUntilUtc().getTime() - lockedUntilUtc.getTime(); + assertTrue(Math.abs(lockedUntilDelta) < 2000); + } + + @Test + public void deserializeDateInEnUsLocaleCorrectly() { + // Arrange + BrokerPropertiesMapper mapper = new BrokerPropertiesMapper(); + Locale defaultLocale = Locale.getDefault(); + Locale.setDefault(Locale.US); + + // Act + BrokerProperties brokerProperties = mapper.fromString(testBrokerPropertiesString); + Locale.setDefault(defaultLocale); + + // Assert + long lockedUntilDelta = brokerProperties.getLockedUntilUtc().getTime() - lockedUntilUtc.getTime(); + assertTrue(Math.abs(lockedUntilDelta) < 2000); + + } + + @Test + public void deserializeDateInZhCnLocaleCorrectly() { + // Arrange + BrokerPropertiesMapper mapper = new BrokerPropertiesMapper(); + Locale defaultLocale = Locale.getDefault(); + Locale.setDefault(Locale.CHINA); + + // Act + BrokerProperties brokerProperties = mapper.fromString(testBrokerPropertiesString); + Locale.setDefault(defaultLocale); + + // Assert + long lockedUntilDelta = brokerProperties.getLockedUntilUtc().getTime() - lockedUntilUtc.getTime(); + assertTrue(Math.abs(lockedUntilDelta) < 2000); + } } From cce6e7c661cb721e4944eaf99d76204945267f54 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Thu, 21 Mar 2013 18:12:32 -0700 Subject: [PATCH 10/12] fix the javadoc documentation issue. --- microsoft-azure-api/pom.xml | 2 +- .../com/microsoft/windowsazure/services/core/package.html | 5 +++++ .../windowsazure/services/core/storage/package.html | 5 +++++ .../services/media/entityoperations/package.html | 5 +++++ .../windowsazure/services/media/models/package.html | 5 +++++ .../com/microsoft/windowsazure/services/media/package.html | 5 +++++ 6 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/core/package.html create mode 100644 microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/core/storage/package.html create mode 100644 microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/entityoperations/package.html create mode 100644 microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/package.html create mode 100644 microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/package.html diff --git a/microsoft-azure-api/pom.xml b/microsoft-azure-api/pom.xml index 1900ba335e49..a931921be3c4 100644 --- a/microsoft-azure-api/pom.xml +++ b/microsoft-azure-api/pom.xml @@ -169,7 +169,7 @@ maven-javadoc-plugin 2.8 - *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.storage /**
* Copyright Microsoft Corporation
* diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/core/package.html b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/core/package.html new file mode 100644 index 000000000000..513ca5833c7a --- /dev/null +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/core/package.html @@ -0,0 +1,5 @@ + + +This package contains the core classes across difference services. + + diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/core/storage/package.html b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/core/storage/package.html new file mode 100644 index 000000000000..b1450b0ca78a --- /dev/null +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/core/storage/package.html @@ -0,0 +1,5 @@ + + +This package contains the blob service core class and interface, + + diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/entityoperations/package.html b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/entityoperations/package.html new file mode 100644 index 000000000000..e7819f147963 --- /dev/null +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/entityoperations/package.html @@ -0,0 +1,5 @@ + + +This package contains the media service OData operation class, interface, and utility classes. + + diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/package.html b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/package.html new file mode 100644 index 000000000000..719e4d9b595c --- /dev/null +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/package.html @@ -0,0 +1,5 @@ + + +This package contains the media service data transfer object classes. + + diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/package.html b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/package.html new file mode 100644 index 000000000000..324cb3246c05 --- /dev/null +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/package.html @@ -0,0 +1,5 @@ + + +This package contains the media services, interface, and associated configuration and utility classes. + + From dcc2a0729bd5dccc3ab8891a433ddf1134219f39 Mon Sep 17 00:00:00 2001 From: "Jason Cooke [Microsoft]" Date: Mon, 25 Mar 2013 11:18:09 -0700 Subject: [PATCH 11/12] Updating version number to 0.4.2 --- README.md | 2 +- microsoft-azure-api/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 22ab0a06a9ec..a8805eb2e326 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ within your project you can also have them installed by the Java package manager com.microsoft.windowsazure microsoft-windowsazure-api - 0.4.1 + 0.4.2 ##Minimum Requirements diff --git a/microsoft-azure-api/pom.xml b/microsoft-azure-api/pom.xml index a931921be3c4..8306962d4382 100644 --- a/microsoft-azure-api/pom.xml +++ b/microsoft-azure-api/pom.xml @@ -17,7 +17,7 @@ 4.0.0 com.microsoft.windowsazure microsoft-windowsazure-api - 0.4.1 + 0.4.2 jar Microsoft Windows Azure Client API From 3e767805dbfa303c84495837ca580f61a63afb8f Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Mon, 25 Mar 2013 15:36:06 -0700 Subject: [PATCH 12/12] fix the failure of a few global unit tests. --- .../CustomPropertiesMapper.java | 25 ++++++++++--------- .../CustomPropertiesMapperTest.java | 16 ++++++------ 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/implementation/CustomPropertiesMapper.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/implementation/CustomPropertiesMapper.java index a12fbb4ee819..89e6fec612bc 100644 --- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/implementation/CustomPropertiesMapper.java +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/implementation/CustomPropertiesMapper.java @@ -2,15 +2,15 @@ * Copyright Microsoft Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.microsoft.windowsazure.services.serviceBus.implementation; @@ -19,6 +19,7 @@ import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; +import java.util.Locale; import java.util.TimeZone; public class CustomPropertiesMapper { @@ -53,14 +54,14 @@ else if (type == Boolean.class) { return value.toString(); } else if (Calendar.class.isAssignableFrom(type)) { - DateFormat format = new SimpleDateFormat(RFC_1123); + DateFormat format = new SimpleDateFormat(RFC_1123, Locale.US); Calendar calendar = (Calendar) value; format.setTimeZone(calendar.getTimeZone()); String formatted = format.format(calendar.getTime()); return "\"" + formatted + "\""; } else if (Date.class.isAssignableFrom(type)) { - DateFormat format = new SimpleDateFormat(RFC_1123); + DateFormat format = new SimpleDateFormat(RFC_1123, Locale.US); format.setTimeZone(TimeZone.getTimeZone("GMT")); String formatted = format.format((Date) value); return "\"" + formatted + "\""; @@ -78,7 +79,7 @@ public Object fromString(String value) throws ParseException { if (value.startsWith("\"") && value.endsWith("\"")) { String text = value.substring(1, value.length() - 1); if (isRFC1123(text)) { - SimpleDateFormat format = new SimpleDateFormat(RFC_1123); + SimpleDateFormat format = new SimpleDateFormat(RFC_1123, Locale.US); return format.parse(text); } @@ -103,7 +104,7 @@ private boolean isRFC1123(String text) { return false; } try { - SimpleDateFormat format = new SimpleDateFormat(RFC_1123); + SimpleDateFormat format = new SimpleDateFormat(RFC_1123, Locale.US); format.parse(text); return true; } diff --git a/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/serviceBus/implementation/CustomPropertiesMapperTest.java b/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/serviceBus/implementation/CustomPropertiesMapperTest.java index 2ab3572c34db..323912b28277 100644 --- a/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/serviceBus/implementation/CustomPropertiesMapperTest.java +++ b/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/serviceBus/implementation/CustomPropertiesMapperTest.java @@ -2,15 +2,15 @@ * Copyright Microsoft Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.microsoft.windowsazure.services.serviceBus.implementation;