19 package org.turro.contacts.profile;
22 import java.io.FileOutputStream;
23 import java.io.IOException;
24 import java.util.logging.Level;
25 import java.util.logging.Logger;
26 import org.turro.contacts.Contact;
27 import org.turro.contacts.db.ContactsPU;
28 import org.turro.elephant.context.ElephantContext;
29 import org.turro.file.util.FileAttach;
30 import org.zkoss.zul.Image;
41 this.contact = contact;
50 private void saveImage() {
51 if(getContent() !=
null) {
54 if(!newFile.getParentFile().exists()) {
55 newFile.getParentFile().mkdirs();
57 try (FileOutputStream fos =
new FileOutputStream(newFile)) {
58 fos.write(getContent().getByteData());
59 }
catch (IOException ex) {
60 Logger.getLogger(ProfileImage.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(
null), ex);
static String getRealPath(String path)