好吧,这就是我的结局
RegionScopedBlobStoreContext blobStoreContext = ContextBuilder
.newBuilder(RS_PROVIDER)
.credentials(RS_USER_NAME, RS_API_KEY)
.buildView(RegionScopedBlobStoreContext.class);
HttpRequest request = blobStoreContext.signerInRegion(regionCode)
.signGetBlob(rackspaceCfContainer.getContainerName(),
rackspaceCfDocHistory.getFileName(),
RS_TEMP_URL_EXP_DUR);
String fileNameParam = "&filename=" + aliasFileName;
String fileNameURLFrag = null;
try {
if (fileNameParam != null)
fileNameURLFrag = UriUtils.encodeFragment(fileNameParam, "UTF-8");
} catch (UnsupportedEncodingException e) {
}
String url = request.getEndpoint().toString();
StringBuffer urlBuffer = new StringBuffer(url);
if (fileNameURLFrag != null)
urlBuffer.append(fileNameURLFrag);
String finalURL = urlBuffer.toString();
这只是一种解决方法,而不是我一直在寻找的解决方案,但它仍然有效,我们可以解决问题。在这里,我只是通过编码的查询参数附加自动生成的 URL。