public void addPhoto(String imageName, String imageDescription, File f) throws Exception { byte[] imageBytes = ImageUtils.loadImageAsBytes(f.getAbsolutePath()); // Note: only the castor Base64Encoder encodes // properly... the Sun one doesn't (corrupts image) String encoded = new String(Base64Encoder.encode(imageBytes)); org.cagrid.demo.photosharing.domain.ImageDescription beanDesc = new org.cagrid.demo.photosharing.domain.ImageDescription(); beanDesc.setId(Long.valueOf(0)); // doesn't matter what // this is set to beanDesc.setDescription(imageDescription); beanDesc.setName(imageName); beanDesc.setType(ImageFileFilter.getExtension(f)); org.cagrid.demo.photosharing.domain.Image beanImage = new org.cagrid.demo.photosharing.domain.Image(); beanImage.setId(Long.valueOf(0)); // doesn't matter what // this is set to beanImage.setImageDescription(beanDesc); beanImage.setData(encoded); getClient().addImage(beanImage); }
public String getDescription() { return des.getDescription(); }
public String getType() { return des.getType(); }
public String getName() { return des.getName(); }