cancel
Showing results for 
Search instead for 
Did you mean: 

Size of a node

toze
Champ in-the-making
Champ in-the-making
How can i get the size of the node? Im trying like this

String filesize = (String) nodeService.getProperty(childNodeRef, ContentModel.PROP_SIZE_CURRENT);

Is this de right way?

And the CIFS location? im trying like this

String filepath = (String) nodeService.getProperty(childNodeRef, ContentModel.PROP_LOCATION);

What im doing wrong? can anyone help please?

Thanks in advanced
2 REPLIES 2

gyro_gearless
Champ in-the-making
Champ in-the-making
To get the content size, you should try something like…


ContentData contentRef =  (ContentData )nodeService.getProperty(childNodeRef, ContentModel.PROP_CONTENT);
long size = contentRef.getSize();

and to get the CIFS you might check method public static String generateURL(FacesContext context, Node node, String name, URLMode usage) in org.alfresco.web.ui.common.Utils

HTH
Gyro

toze
Champ in-the-making
Champ in-the-making
Thanks for your reply