As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
In custom event listener handler that listening documentCreated or documentModified event, how can i get the document size info ?
What do you mean by "document size info"?
If what you meant is main binary (file:content) file size, if the info was provided when the blob was uploaded, in a Java Event Listener you can retrieve it using the following code (Blob class from package org.nuxeo.ecm.core.api):
((Blob) doc.getPropertyValue("file:content")).getLength()
The value will be expressed in bytes if known, else it will be -1
Hi, thanks for quick reply. The answer may work in most scenes, but not for all the document types.
what I want is to get the specific space usage of the document when a got an document is created or modified( in the event handler) , How to do that ?