InputStream in = node.getProperty("jcr:data").getStream();
ByteArrayOutputStream out = new ByteArrayOutputStream(500 * 1024);
makeThumbnail(in, out);
out.flush();
node.setProperty("dms:Thumbnail", new ByteArrayInputStream(out
.toByteArray()));
node.save();
转载于:https://my.oschina.net/u/2296689/blog/545737