Regardless of what source access conditions are provided in the options of CopyBlob, the calls succeed. This is because of an issue in PipelineHelpers.addOptionalSourceAccessContitionHeader, reproduced here:
switch (accessCondition.getHeader()) {
case IF_MATCH:
headerName = "x-ms-source-if-match";
case IF_UNMODIFIED_SINCE:
headerName = "x-ms-source-if-unmodified-since";
case IF_MODIFIED_SINCE:
headerName = "x-ms-source-if-modified-since";
case IF_NONE_MATCH:
headerName = "x-ms-source-if-none-match";
default:
headerName = "";
}
The problem is that in Java, one case cascades into the next, so regardless of the value of the Header property, the headerName is always the empty string.
The fix is to add a break; statement at the end of each case block.
Regardless of what source access conditions are provided in the options of CopyBlob, the calls succeed. This is because of an issue in
PipelineHelpers.addOptionalSourceAccessContitionHeader, reproduced here:The problem is that in Java, one case cascades into the next, so regardless of the value of the Header property, the
headerNameis always the empty string.The fix is to add a
break;statement at the end of eachcaseblock.