try {
if (request.getContentLength() == 0)
return ResourceWebServiceHelper.buildErrorPage(resource.stringValue(), configurationService.getBaseUri(), Status.BAD_REQUEST, "content may not be empty for writting", configurationService, templatingService);
contentService.setContentStream(resource, request.getInputStream(), mimetype); // store content
if(configurationService.getBooleanConfiguration(ENHANCER_STANBOL_ENHANCER_ENABLED, false)) {
afterContentCreated.fire(new ContentCreatedEvent(resource)); //enhancer
}
return Response.ok().build();
} catch (IOException e) {
return ResourceWebServiceHelper.buildErrorPage(resource.stringValue(), configurationService.getBaseUri(), Status.BAD_REQUEST, "could not read request body", configurationService, templatingService);
} catch (WritingNotSupportedException e) {