Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge release to mater #295

Merged
merged 153 commits into from
Mar 14, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
153 commits
Select commit Hold shift + click to select a range
8a143d8
update the unit tests so that the job integration tests have the right
Jan 14, 2013
624cfa2
add TaskHistoricalEvent to the queue.
Jan 14, 2013
84c6bd5
partial checkin for task historical event
Jan 15, 2013
76d9ecc
initial check in to add task historical event type.
Jan 15, 2013
8e9fdcf
Merge pull request #101 from WindowsAzure/dev
Jan 15, 2013
7d5b4b6
second checkin to support task historical events.
Jan 16, 2013
2cebbbd
Merge pull request #99 from gcheng/bettertests
Jan 21, 2013
c3cfb9f
Merge pull request #626 from gcheng/dev
Jan 21, 2013
6760316
Merge pull request #104 from WindowsAzure/dev
Jan 22, 2013
b76886a
Merge pull request #105 from gcheng/dev
Jan 22, 2013
466c43b
add job integration test for taskhistorical event
Jan 23, 2013
84c47af
Fix JavaDoc build warnings
jcookems Jan 23, 2013
f4d3d60
Fixing checkstyle errors for Media Services, issue #204.
jcookems Jan 23, 2013
a1f7bc6
Merge pull request #4 from jcookems/fixDocWarnings
jcookems Jan 23, 2013
3a63e0e
Update `settingTimeoutPrefixedFromConfigWorks` to test state of the c…
jcookems Jan 23, 2013
baaf794
Removing code to pre-clean tables, because the table names are now un…
jcookems Jan 23, 2013
bd8d7c1
Merge pull request #5 from jcookems/fixCheckStyle
jcookems Jan 23, 2013
84dc395
Convert readField from recursive to iterative.
jcookems Jan 23, 2013
c3a60fb
Merge pull request #6 from jcookems/fix210
jcookems Jan 23, 2013
64b3938
Merge pull request #211 from jcookems/dev
jcookems Jan 23, 2013
cc327c0
Merge branch 'dev' of https://github.com/WindowsAzure/azure-sdk-for-j…
jcookems Jan 24, 2013
455f906
Merge pull request #631 from jcookems/dev
jcookems Jan 24, 2013
f7dce4b
code review feedback.
Jan 25, 2013
0ef9985
Merge pull request #100 from gcheng/historicalevents
Jan 25, 2013
6db3cad
a missed unit test.
Jan 25, 2013
3531068
Merge pull request #106 from gcheng/historicalevents
Jan 25, 2013
04160b9
Merge pull request #632 from gcheng/dev
Jan 25, 2013
78067fc
Minor changes to address the compile-time warnings
jcookems Jan 28, 2013
7a8812e
Remove trivial TODO comments from tests
jcookems Jan 29, 2013
dda240d
Removing trivial TODO Auto-generated comments
jcookems Jan 29, 2013
40bd3e5
Replace trivial *if* statement with more useful Assert
jcookems Jan 29, 2013
269db3f
Remove "catch (InterruptedException e)" that could obscure unexpected…
jcookems Jan 29, 2013
da209fe
Merge pull request #32 from jcookems/fixWarnings
jcookems Jan 29, 2013
0413d38
Merge pull request #634 from jcookems/dev
jcookems Jan 29, 2013
4bf887e
Remove hard-coded Fiddler code in tests
jcookems Jan 29, 2013
277921f
Adding deltas to assertEquals for Date and Double, which are likely t…
jcookems Jan 29, 2013
4e7c7d4
Updated ignore
Jan 30, 2013
16cd488
Merge branch 'master' of https://github.com/WindowsAzure/azure-sdk-fo…
Jan 30, 2013
68a61bc
Merge branch 'dev' of https://github.com/WindowsAzure/azure-sdk-for-j…
Jan 30, 2013
5679d73
First cut at base class for connection string parsing.
Jan 31, 2013
88a1f7a
Updated based on code review, rewrite parser based on grammar from Jason
Feb 1, 2013
702c26a
Added back in test that was accidentally removed
Feb 1, 2013
886535a
Merge pull request #5 from christav/servicebus-connection-strings
Feb 1, 2013
13ef42a
Merge pull request #212 from christav/dev
Feb 1, 2013
a98c882
Working towards connection string support in service bus
Feb 1, 2013
50929a6
Connection settings class fully plumbed through config
Feb 1, 2013
d010841
Switched tests to running off connection string instead of individual…
Feb 1, 2013
e001391
Fixed up exception reporting, fixed so tests actually use connection …
Feb 2, 2013
87d5ba9
Adding testing for various configuration permutations.
Feb 4, 2013
959a3c9
Made connection settings package visible rather than public.
Feb 4, 2013
ba3e0f3
Only replace sb:// at start of connection string value
Feb 4, 2013
0f4a168
Merge pull request #6 from christav/servicebus-connection-strings
Feb 5, 2013
9d9e65c
Merge pull request #215 from christav/dev
Feb 5, 2013
fde1416
Adding javadocs for missing parameters
Feb 5, 2013
27be399
Merge pull request #7 from christav/servicebus-javadoc-update
Feb 5, 2013
e35b776
Merge pull request #216 from christav/dev
Feb 5, 2013
614e96e
Merge pull request #33 from jcookems/fix205
jcookems Feb 6, 2013
eaf464c
Merge pull request #639 from jcookems/dev
jcookems Feb 6, 2013
8bca4e7
Removed leaseId from function signature - it isn't used by the service.
Feb 6, 2013
df49d89
initial checkin for user agent filter.
Feb 6, 2013
6faeb7c
get user agent working with media service.
Feb 7, 2013
939e60c
Added return value for breakLease. Also fixed some warnings in the bl…
Feb 7, 2013
3e8b32b
Updated doc comments
Feb 7, 2013
a053200
enable UserAgent in Blob, ServiceBus, Queue and Table.
Feb 7, 2013
b8a9257
fix up of related classes.
Feb 7, 2013
11dc82d
Added back original overloads of breakLease to keep back compat, mark…
Feb 7, 2013
df8140d
Merge pull request #8 from christav/update-breaklease-signature-88
Feb 7, 2013
3fc489f
Merge pull request #228 from christav/dev
Feb 7, 2013
781a0f4
code review feedback.
Feb 8, 2013
8c7ffac
Merge pull request #14 from gcheng/useragent
Feb 8, 2013
fbec962
Merge branch 'dev' of https://github.com/WindowsAzure/azure-sdk-for-j…
Feb 8, 2013
9b8ab6d
Fixed test cross contamination - create new config, don't reuse curre…
Feb 8, 2013
9cc5440
Merge pull request #9 from christav/connectionstring-test-fixes-232
Feb 8, 2013
79f2e3e
Merge pull request #233 from christav/dev
Feb 8, 2013
55c81f8
resolve a merge conflict.
Feb 8, 2013
686f91c
Minor changes to address the compile-time warnings
jcookems Jan 28, 2013
9c2243a
Remove trivial TODO comments from tests
jcookems Jan 29, 2013
b375ecb
Removing trivial TODO Auto-generated comments
jcookems Jan 29, 2013
2d0299f
Replace trivial *if* statement with more useful Assert
jcookems Jan 29, 2013
5d6f96d
Remove "catch (InterruptedException e)" that could obscure unexpected…
jcookems Jan 29, 2013
5912b78
Remove hard-coded Fiddler code in tests
jcookems Jan 29, 2013
cac506d
Adding deltas to assertEquals for Date and Double, which are likely t…
jcookems Jan 29, 2013
9a44b2d
Merge pull request #240 from gcheng/dev
Feb 11, 2013
2134d76
Fixing new warnings
jcookems Feb 12, 2013
d321286
Merge pull request #7 from jcookems/cleanup1
jcookems Feb 12, 2013
e46ebae
Merge branch 'dev' of github.com:jcookems/azure-sdk-for-java into dev
jcookems Feb 12, 2013
f534e85
Merge pull request #241 from jcookems/dev
jcookems Feb 12, 2013
12e254d
fix an issue on Jason's machine.
Feb 13, 2013
73e1961
Merge pull request #16 from gcheng/useragentfilter
Feb 14, 2013
38ec313
Merge pull request #242 from gcheng/dev
Feb 14, 2013
315f243
Add java test cases for WA GB18030 Certification.
Feb 18, 2013
b208494
1. Fix Copyright info
Feb 19, 2013
03c4f3b
Removed extra print
Feb 19, 2013
c427848
Merge pull request #10 from christav/remove-console-output-244
Feb 19, 2013
ed834aa
Merge pull request #248 from christav/dev
Feb 19, 2013
c744072
fix path in readme file.
Feb 20, 2013
83228b7
Merge pull request #17 from gcheng/readme
Feb 20, 2013
abbbe10
Merge pull request #250 from gcheng/dev
Feb 20, 2013
38b3a52
[JXSCL] : Make OperationContext RequestResults thread safe,
Feb 20, 2013
2f347c3
Merge pull request #247 from LucieZhou/master
jcookems Feb 20, 2013
f5e7c15
CR Feedback - Update tasks to provide result affinity. Now the Reque…
Feb 21, 2013
118bac1
Make BlobOutputStream use latest instead of uncommitted.
Feb 21, 2013
5b39feb
Reduced characters that get encoded to just the illegal set
Feb 22, 2013
3f7bf11
Added surrogate pair character to test
Feb 22, 2013
836828d
Merge pull request #11 from christav/fix-encoding-111
Feb 22, 2013
c4268a5
Merge pull request #258 from christav/dev
Feb 22, 2013
08648cc
Merge branch 'dev' of https://github.com/WindowsAzure/azure-sdk-for-j…
Feb 22, 2013
36ebeb4
BlobInputStream MD5 verification fix and a couple more fixes
Feb 22, 2013
940a8b6
Pull from WindowsAzure/dev
Feb 22, 2013
11b1a31
CR feedback: Update tasks to provide result affinity
Feb 25, 2013
bed1f7d
Merge branch 'dev' of https://github.com/WindowsAzure/azure-sdk-for-j…
guangyang Feb 25, 2013
83c5aa8
Fixed test for surrogate pair, removed encoding
Feb 26, 2013
dcc318c
Merge pull request #12 from christav/encoding-111
Feb 26, 2013
98e2a46
Merge pull request #260 from christav/dev
Feb 26, 2013
19ef20c
fix the broken unit test due to nimbus server upgrade.
Feb 26, 2013
4f692bb
fix another unit test due to nimbus server upgrade.
Feb 26, 2013
77c9477
Merge pull request #107 from gcheng/unittestclean
Feb 26, 2013
ce4a3bf
Merge pull request #644 from gcheng/dev
Feb 26, 2013
c99a721
Removed copyright year from javadoc header
Feb 27, 2013
e78d698
Merge pull request #13 from christav/remove-date-256
Feb 27, 2013
53350d6
Merge pull request #261 from christav/dev
Feb 27, 2013
a542d78
Merge pull request #18 from WindowsAzure/dev
Feb 27, 2013
742b0e2
Clean up service bus assets created as part of test at the end.
Feb 27, 2013
731245a
Merge pull request #14 from christav/sb-test-cleanup-118
Feb 27, 2013
dc4575c
Merge pull request #263 from christav/dev
Feb 27, 2013
ff3d149
fix the broken unit test due to nimbus server upgrade.
Feb 26, 2013
34d7de1
fix another unit test due to nimbus server upgrade.
Feb 26, 2013
782319d
CR feedback remove extra line
Feb 27, 2013
cba4c0d
Merge branch 'dev' of https://github.com/WindowsAzure/azure-sdk-for-j…
Feb 27, 2013
39a498f
fix a broken unit test
Feb 27, 2013
84403a6
Merge pull request #20 from gcheng/fixunittests
Feb 27, 2013
8e7fc15
Merge pull request #264 from gcheng/dev
Feb 27, 2013
c5345f2
Merge branch 'dev' of https://github.com/sozler/azure-sdk-for-java in…
Feb 28, 2013
57335fe
Update Changelog for latest fixes
Feb 28, 2013
b792da2
Merge branch 'dev' of https://github.com/WindowsAzure/azure-sdk-for-j…
Mar 1, 2013
927e31e
Merge branch 'dev' of https://github.com/WindowsAzure/azure-sdk-for-j…
Mar 1, 2013
557804b
Merge branch 'dev' of https://github.com/sozler/azure-sdk-for-java in…
Mar 1, 2013
6575ffa
Merge pull request #282 from sozler/dev
Mar 6, 2013
22961d2
Merge branch 'release' of github.com:WindowsAzure/azure-sdk-for-java …
jcookems Mar 8, 2013
6ad950a
Merge branch 'release' of https://github.com/WindowsAzure/azure-sdk-f…
Mar 8, 2013
0145416
Merge pull request #34 from jcookems/int
jcookems Mar 8, 2013
7f614ec
Merge pull request #651 from jcookems/dev
jcookems Mar 8, 2013
48ca51e
Merge pull request #9 from jcookems/int
jcookems Mar 8, 2013
492299f
Merge pull request #290 from jcookems/release
jcookems Mar 8, 2013
398e721
Updating POM version
jcookems Mar 8, 2013
11ec4a9
Merge pull request #291 from jcookems/release
jcookems Mar 8, 2013
5fc77e0
Merge pull request #289 from joeg/devMerge
Mar 9, 2013
b6928e0
Merge branch 'release' of https://github.com/WindowsAzure/azure-sdk-f…
guangyang Mar 11, 2013
baff388
update changelog for 0.4.1
guangyang Mar 11, 2013
1944273
update change log and readme.md based on PR review feedback
guangyang Mar 11, 2013
dd74ec3
fixing policheck issues
guangyang Mar 11, 2013
f0d6ca3
fixing policheck issues
guangyang Mar 11, 2013
e92621b
Merge pull request #292 from guangyang/release
guangyang Mar 11, 2013
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
.project
target
node_modules
.idea
*.iml
20 changes: 17 additions & 3 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
2013.1.18 Version 0.4.0
2013.03.12 Version 0.4.1
* Added "Azure-SDK-For-Java/<version>" To User-Agent HTTP header
* Added connection string support for Service Bus
* Added new methods to break lease for Storage Blob which doesn't require a lease id and returns the result as an object. Deprecated the old breakLease() methods.
* Added a new method to get the historical events for Media Services
* Fixed Storage Table encoding issue for special characters
* BlobOutputStream now commits block list using LATEST instead of UNCOMMITTED
* Added RequestResult to StorageEvents
* Fixed issue when accessing OperationContext RequestResults
* Fixed the return value of BlobInputStream.read
* Fixed CloudPageBlob.downloadPageRanges to retrieve the blob length
* Fixed MD5 validation in BlobInputStream
* Return ETag in TableResult not only for Insert but also for other operations

2013.01.18 Version 0.4.0
* Added support for Windows Azure Media Services
* Updated dependencies to non-beta stable versions
* Add a Sending Request Event to OperationContext in Storage Client code
* Fix a bug in the STorage client in blob download resume for blobs greater than 2GB
* Added a Sending Request Event to OperationContext in Storage Client code
* Fixed a bug in the Storage client in blob download resume for blobs greater than 2GB

2012.10.29 Version 0.3.3
* In the blob client, fixed a bug which allows users to call write APIs on a blob snapshot reference
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ For documentation please see the [Windows Azure Java Developer Center](http://ww
To get the source code of the SDK via git just type:

git clone git://github.com/WindowsAzure/azure-sdk-for-java.git
cd ./azure-sdk-for-java
cd ./azure-sdk-for-java/microsoft-azure-api/
mvn compile

###Option 2: Via Maven
Expand All @@ -45,7 +45,7 @@ within your project you can also have them installed by the Java package manager
<dependency>
<groupId>com.microsoft.windowsazure</groupId>
<artifactId>microsoft-windowsazure-api</artifactId>
<version>0.4.0</version>
<version>0.4.1</version>
</dependency>

##Minimum Requirements
Expand Down
4 changes: 2 additions & 2 deletions microsoft-azure-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.microsoft.windowsazure</groupId>
<artifactId>microsoft-windowsazure-api</artifactId>
<version>0.4.0</version>
<version>0.4.1</version>
<packaging>jar</packaging>

<name>Microsoft Windows Azure Client API</name>
Expand Down Expand Up @@ -171,7 +171,7 @@
<configuration>
<excludePackageNames>*.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization</excludePackageNames>
<bottom><![CDATA[<code>/**
<br/>* Copyright 2011 Microsoft Corporation
<br/>* Copyright Microsoft Corporation
<br/>*
<br/>* Licensed under the Apache License, Version 2.0 (the "License");
<br/>* you may not use this file except in compliance with the License.
Expand Down
6 changes: 5 additions & 1 deletion microsoft-azure-api/src/config/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,11 @@

<module name="IllegalInstantiation"/>
<module name="InnerAssignment"/>
<module name="MagicNumber"/>
<module name="MagicNumber">
<!-- Updated on 01/23/2013: -->
<!-- Added ignore list, to keep enums from triggering violations -->
<property name="ignoreNumbers" value="0, 1, 2, 3, 4, 5, 6, 7, 8"/>
</module>
<module name="MissingSwitchDefault"/>
<module name="RedundantThrows"/>
<module name="SimplifyBooleanExpression"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -50,7 +50,6 @@ public final class RoleEnvironment {
JAXBContext.newInstance(RoleEnvironment.class.getPackage().getName());
}
catch (JAXBException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
clientId = UUID.randomUUID().toString();
Expand Down Expand Up @@ -93,6 +92,7 @@ private static synchronized void initialize() {
lastState = new AtomicReference<CurrentState>();

runtimeClient.addGoalStateChangedListener(new GoalStateChangedListener() {
@Override
public void goalStateChanged(GoalState newGoalState) {
switch (newGoalState.getExpectedState()) {
case STARTED:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.microsoft.windowsazure.services.blob.models.AcquireLeaseResult;
import com.microsoft.windowsazure.services.blob.models.BlobServiceOptions;
import com.microsoft.windowsazure.services.blob.models.BlockList;
import com.microsoft.windowsazure.services.blob.models.BreakLeaseResult;
import com.microsoft.windowsazure.services.blob.models.CommitBlobBlocksOptions;
import com.microsoft.windowsazure.services.blob.models.ContainerACL;
import com.microsoft.windowsazure.services.blob.models.CopyBlobOptions;
Expand Down Expand Up @@ -1440,16 +1441,23 @@ void releaseLease(String container, String blob, String leaseId, BlobServiceOpti
* <p>
* A lease that has been broken but has not yet expired can also be released, in which case another client may
* immediately acquire a new lease on the blob.
*
*
* @deprecated Server ignores the leaseId parameter, replaced by {@link #breakLease(String, String)} without
* the useless parameter.
*
* @param container
* A {@link String} containing the name of the blob's container.
* @param blob
* A {@link String} containing the name of the blob to break a lease on.
* @param leaseId
* A {@link String} containing an optional lease ID.
*
* @param leaseId lease id to break. Ignored.
*
* @throws ServiceException
* if an error occurs accessing the storage service.
*
* @return result containing time remaining before a new lease can be acquired
*/
@Deprecated()
void breakLease(String container, String blob, String leaseId) throws ServiceException;

/**
Expand All @@ -1465,17 +1473,78 @@ void releaseLease(String container, String blob, String leaseId, BlobServiceOpti
* <p>
* A lease that has been broken but has not yet expired can also be released, in which case another client may
* immediately acquire a new lease on the blob.
*
*
* @deprecated Server ignores the leaseId parameter, replaced by
* {@link #breakLease(String, String, com.microsoft.windowsazure.services.blob.models.BlobServiceOptions)}
* without the useless parameter.
*
*
* @param container
* A {@link String} containing the name of the blob's container.
* @param blob
* A {@link String} containing the name of the blob to break a lease on.
* @param leaseId
* A {@link String} containing an optional lease ID.
* @param options
* A {@link BlobServiceOptions} instance containing options for the request.
* A {@link com.microsoft.windowsazure.services.blob.models.BlobServiceOptions} instance containing options for the request.
* @param leaseId lease id to break. Ignored.
*
* @throws ServiceException
* if an error occurs accessing the storage service.
* @return result containing time remaining before a new lease can be acquired
*/
@Deprecated()
void breakLease(String container, String blob, String leaseId, BlobServiceOptions options) throws ServiceException;

/**
* Breaks an active lease on a blob.
* <p>
* This method breaks the lease on the blob specified by the <em>blob</em> and <em>container</em> parameters. The
* <em>leaseId</em> parameter is not used by the server.
* <p>
* Once a lease is broken, it cannot be renewed. Any authorized request can break the lease; the request is not
* required to specify a matching lease ID. When a lease is broken, the remaining time on the lease is allowed to
* elapse, during which time no lease operation may be performed on the blob.
* <p>
* A lease that has been broken but has not yet expired can also be released, in which case another client may
* immediately acquire a new lease on the blob.
*
*
*
* @param container
* A {@link String} containing the name of the blob's container.
* @param blob
* A {@link String} containing the name of the blob to break a lease on.
* @throws ServiceException
* if an error occurs accessing the storage service.
*
* @return result containing time remaining before a new lease can be acquired
*/
BreakLeaseResult breakLease(String container, String blob) throws ServiceException;

/**
* Breaks an active lease on a blob, using the specified options.
* <p>
* This method breaks the lease on the blob specified by the <em>blob</em> and <em>container</em> parameters. The
* <em>leaseId</em> parameter is not used by the server. Use the {@link BlobServiceOptions options} parameter to
* specify the server timeout for the operation.
* <p>
* Once a lease is broken, it cannot be renewed. Any authorized request can break the lease; the request is not
* required to specify a matching lease ID. When a lease is broken, the remaining time on the lease is allowed to
* elapse, during which time no lease operation may be performed on the blob.
* <p>
* A lease that has been broken but has not yet expired can also be released, in which case another client may
* immediately acquire a new lease on the blob.
*
*
*
* @param container
* A {@link String} containing the name of the blob's container.
* @param blob
* A {@link String} containing the name of the blob to break a lease on.
* @param options
* A {@link com.microsoft.windowsazure.services.blob.models.BlobServiceOptions} instance containing options for the request.
* @throws ServiceException
* if an error occurs accessing the storage service.
* @return result containing time remaining before a new lease can be acquired
*/
BreakLeaseResult breakLease(String container, String blob, BlobServiceOptions options) throws ServiceException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.microsoft.windowsazure.services.blob.implementation.SharedKeyFilter;
import com.microsoft.windowsazure.services.blob.implementation.SharedKeyLiteFilter;
import com.microsoft.windowsazure.services.core.Builder;
import com.microsoft.windowsazure.services.core.UserAgentFilter;

public class Exports implements Builder.Exports {
@Override
Expand All @@ -30,5 +31,6 @@ public void register(Builder.Registry registry) {
registry.add(SharedKeyLiteFilter.class);
registry.add(SharedKeyFilter.class);
registry.add(ISO8601DateConverter.class);
registry.add(UserAgentFilter.class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public void setLeaseStatus(final LeaseStatus leaseStatus) {
/**
* Sets the lease status on the container. Reserved for internal use.
*
* @param LeaseState
* @param leaseState
* The lease state to set, as a <code>LeaseState</code> object.
*/
public void setLeaseState(final LeaseState leaseState) {
Expand All @@ -141,7 +141,7 @@ public void setLeaseState(final LeaseState leaseState) {
/**
* Sets the lease duration on the container. Reserved for internal use.
*
* @param LeaseDuration
* @param leaseDuration
* The lease duration to set, as a <code>LeaseDuration</code> object.
*/
public void setLeaseDuration(final LeaseDuration leaseDuration) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ public final class BlobInputStream extends InputStream {
*/
private boolean validateBlobMd5;

/**
* Holds the Blob MD5.
*/
private final String retrievedContentMD5Value;

/**
* Holds the reference to the current buffered data.
*/
Expand Down Expand Up @@ -161,11 +166,11 @@ protected BlobInputStream(final CloudBlob parentBlob, final AccessCondition acce

final HttpURLConnection attributesRequest = this.opContext.getCurrentRequestObject();

final String retrievedContentMD5Value = attributesRequest.getHeaderField(Constants.HeaderConstants.CONTENT_MD5);
this.retrievedContentMD5Value = attributesRequest.getHeaderField(Constants.HeaderConstants.CONTENT_MD5);

// Will validate it if it was returned
this.validateBlobMd5 = !options.getDisableContentMD5Validation()
&& !Utility.isNullOrEmpty(retrievedContentMD5Value);
&& !Utility.isNullOrEmpty(this.retrievedContentMD5Value);

// Validates the first option, and sets future requests to use if match
// request option.
Expand Down Expand Up @@ -395,8 +400,17 @@ public boolean markSupported() {
@DoesServiceRequest
public int read() throws IOException {
final byte[] tBuff = new byte[1];
this.read(tBuff, 0, 1);
return tBuff[0];
final int numberOfBytesRead = this.read(tBuff, 0, 1);

if (numberOfBytesRead > 0) {
return tBuff[0] & 0xFF;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great :-/

}
else if (numberOfBytesRead == 0) {
throw new IOException("Unexpected error. Stream returned unexpected number of bytes.");
}
else {
return -1;
}
}

/**
Expand Down Expand Up @@ -519,13 +533,13 @@ private synchronized int readInternal(final byte[] b, final int off, int len) th
if (this.currentAbsoluteReadPosition == this.streamLength) {
// Reached end of stream, validate md5.
final String calculatedMd5 = Base64.encode(this.md5Digest.digest());
if (!calculatedMd5.equals(this.parentBlobRef.getProperties().getContentMD5())) {
if (!calculatedMd5.equals(this.retrievedContentMD5Value)) {
this.lastError = Utility
.initIOException(new StorageException(
StorageErrorCodeStrings.INVALID_MD5,
String.format(
"Blob data corrupted (integrity check failed), Expected value is %s, retrieved %s",
this.parentBlobRef.getProperties().getContentMD5(), calculatedMd5),
this.retrievedContentMD5Value, calculatedMd5),
Constants.HeaderConstants.HTTP_UNUSED_306, null, null));
this.streamFaulted = true;
throw this.lastError;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ private synchronized void dispatchWrite(final int writeLength) throws IOExceptio
if (this.streamType == BlobType.BLOCK_BLOB) {
final CloudBlockBlob blobRef = (CloudBlockBlob) this.parentBlobRef;
final String blockID = Base64.encode(Utility.getBytesFromLong(this.blockIdSequenceNumber++));
this.blockList.add(new BlockEntry(blockID, BlockSearchMode.UNCOMMITTED));
this.blockList.add(new BlockEntry(blockID, BlockSearchMode.LATEST));

worker = new Callable<Void>() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ public void setLeaseStatus(final LeaseStatus leaseStatus) {
/**
* Sets the lease state for the blob. Reserved for internal use.
*
* @param LeaseState
* @param leaseState
* The lease state to set, represented by a <code>LeaseState</code> object.
*/
public void setLeaseState(final LeaseState leaseState) {
Expand All @@ -344,7 +344,7 @@ public void setLeaseState(final LeaseState leaseState) {
/**
* Sets the lease duration for the blob. Reserved for internal use.
*
* @param LeaseDuration
* @param leaseDuration
* The lease duration value to set, represented by a <code>LeaseDuration</code> object.
*/
public void setLeaseDuration(final LeaseDuration leaseDuration) {
Expand Down
Loading