}
//checking esciz
if (constructionExample.getWayToDefectEsckiz() == null || constructionExample.getWayToDefectEsckiz().equals("")) {
//retrieving esciz from object construction
ObjectConstruction objectConstruction = objectConstructionManager.getObjectConstruction(constructionExample.getObjectConstructionId().toString());
//esciz for defects
if (objectConstruction.getEsckizBlob() != null && objectConstruction.getWayToEsckiz() != null && !objectConstruction.getWayToEsckiz().equals("")) {
String wayToDefectEskiz = ImageUtil.getUniqueJPEGFile(request);
constructionExample.setWayToDefectEsckiz(wayToDefectEskiz);
objectConstruction.getEsckizBlob();
File file = new File(FileHelper.getCurrentPath(request) + wayToDefectEskiz);
file.createNewFile();
FileOutputStream fileOutputStream = new FileOutputStream(FileHelper.getCurrentPath(request) + wayToDefectEskiz);
Blob blob = objectConstruction.getEsckizBlob();
byte[] bufer = new byte[62000];
InputStream inputStream = blob.getBinaryStream();
while (inputStream.read(bufer) != -1) {
fileOutputStream.write(bufer);
}
inputStream.close();
fileOutputStream.close();
//esciz for power points
String wayToPowerEskiz = ImageUtil.getUniqueJPEGFile(request);
constructionExample.setWayToPowerEsckiz(wayToPowerEskiz);
objectConstruction.getEsckizBlob();
file = new File(FileHelper.getCurrentPath(request) + wayToPowerEskiz);
if (file.exists()) {
file.delete();
}
file.createNewFile();
fileOutputStream = new FileOutputStream(FileHelper.getCurrentPath(request) + wayToPowerEskiz);
blob = objectConstruction.getEsckizBlob();
byte[] powerBufer = new byte[62000];
inputStream = blob.getBinaryStream();
while (inputStream.read(powerBufer) != -1) {
fileOutputStream.write(powerBufer);
}