一起来,看看它的类型cm:content
与否:
QName nodeType = nodeService.getType(nodeRef);
if (! dictionaryService.isSubClass(nodeType, ContentModel.TYPE_CONTENT)) {
// Not content, so content can't be binary
return false;
}
接下来,你需要获取Content
节点属性,which'll是一个对象contentData内容,最后检查的MIME类型在那。
ContentData contentData = (ContentData)nodeService.getProperty(
nodeRef, ContentModel.PROP_CONTENT);
String mimetype = contentData.getMimetype();
if (mimetype == null) {
// No idea...
} else if (mimetype.startsWith("text/")) {
// Shouldn't be binary
return false;
} else {
// Most likely binary, but there are a few unusual mimetypes
// not under the text/* range that are text...
return true;
}
你不需要去或contentService的阅读实际内容,只得到保存它
元数据