10-15-2024 07:09 AM
In custom event listener handler that listening documentCreated or documentModified event, how can i get the document size info ?
10-15-2024 10:46 AM
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
10-16-2024 04:55 AM - edited 10-16-2024 04:56 AM
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 ?
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.