i think the only way to know the size is to get the `length` property of the nt:resource child of the nt:file. the folder knows nothing afaik: see for example http://tugdualgrall.blogspot.ch/2011/03/how-to-calculate-size-of-folder-in-jcr.html

for the file size, the best way probably is to map the node and get the length of the `jcr:data` property from there (as getting that length will not load the stream yet, saving us the resources)