Backport #385 to 1.7.x branch

This PR backports #385 to the 1.7.x branch.

JIRA: https://issues.apache.org/jira/browse/JCLOUDS-471