Beispiel #1
0
 protected void setValueBlob(T state, Blob blob) throws PropertyException {
   BlobInfo blobInfo = new BlobInfo();
   if (blob != null) {
     BlobManager blobManager = Framework.getService(BlobManager.class);
     try {
       blobInfo.key = blobManager.writeBlob(blob, this);
     } catch (IOException e) {
       throw new PropertyException("Cannot get blob info for: " + blob, e);
     }
     blobInfo.filename = blob.getFilename();
     blobInfo.mimeType = blob.getMimeType();
     blobInfo.encoding = blob.getEncoding();
     blobInfo.digest = blob.getDigest();
     blobInfo.length = blob.getLength() == -1 ? null : Long.valueOf(blob.getLength());
   }
   setBlobInfo(state, blobInfo);
 }