// get parameters
String objectId = getStringParameter(request, Constants.PARAM_ID);
String changeToken = getStringParameter(request, Constants.PARAM_CHANGE_TOKEN);
Boolean overwriteFlag = getBooleanParameter(request, Constants.PARAM_OVERWRITE_FLAG);
ContentStreamImpl contentStream = new ContentStreamImpl();
contentStream.setStream(request.getInputStream());
contentStream.setMimeType(request.getHeader("Content-Type"));
String lengthStr = request.getHeader("Content-Length");
if (lengthStr != null) {
try {
contentStream.setLength(new BigInteger(lengthStr));
} catch (NumberFormatException e) {
}
}
String contentDisposition = request.getHeader(MimeHelper.CONTENT_DISPOSITION);
if (contentDisposition != null) {
contentStream.setFileName(MimeHelper.decodeContentDispositionFilename(contentDisposition));
}
// execute
Holder<String> objectIdHolder = new Holder<String>(objectId);
service.setContentStream(repositoryId, objectIdHolder, overwriteFlag, changeToken == null ? null