objectPhotoManager.removeObjectPhoto(objectPhoto.getPhotoId().toString());
buildingObject.getPhotoes().remove(objectPhoto);
buildingObjectManager.saveBuildingObject(buildingObject);
saveMessage(request, getText("objectPhoto.deleted", locale));
} else {
MultipartHttpServletRequest multipartRequest =
(MultipartHttpServletRequest) request;
CommonsMultipartFile file =
(CommonsMultipartFile) multipartRequest.getFile("file");
if (file.getSize() > 0) {
String fileName = ImageUtil.getUniqueJPEGFile(request);
FileOutputStream fileOutputStream = new FileOutputStream(FileHelper.getCurrentPath(request) + fileName);
fileOutputStream.write(file.getBytes());
fileOutputStream.close();