ImageAsset.fileExtension(imageEncoding);
} else {
newUrl = getFileName(oldUrl);
}
MPSApplicationContext applicationContext =
(MPSApplicationContext)ContextInternals
.getApplicationContext(requestContext);
HttpServletResponse response =
(HttpServletResponse)((MarinerServletRequestContext)requestContext).getResponse();
if (assetGroup != null) {
response.setHeader("asset." +
assetGroup.getLocationType() +
"." +
Base64.encodeString(newUrl),
Base64.encodeString(oldUrl));
applicationContext.mapAsset(newUrl,
new MessageAsset(assetGroup.getLocationType(), oldUrl));
} else {
response.setHeader("asset." +
AssetGroup.ON_SERVER +
"." +
Base64.encodeString(newUrl),
Base64.encodeString(oldUrl));
applicationContext.mapAsset(newUrl,
new MessageAsset(AssetGroup.ON_SERVER, oldUrl));
}
// Add headers for maximum file and MM (message) sizes.
// This reuses the names found in the
// MarinerPageContext#constructURL method and also used in the
// MPSApplicationContext#setDevice method
Integer maxFileSize = applicationContext.getMaxFileSize();
Integer maxMMSize = applicationContext.getMaxMMSize();
if (maxFileSize != null) {
response.setHeader("maxfilesize", maxFileSize.toString());
}
if (maxMMSize != null) {
response.setHeader("maxmmsize", maxMMSize.toString());