code: public long getNodeDataSizeDirectly(final String nodePath) throws QuotaManagerException
     {
        try
        {
           return SecurityHelper.doPrivilegedExceptionAction(new PrivilegedExceptionAction<Long>()
           {
              public Long run() throws Exception
              {
                 if (nodePath.equals(JCRPath.ROOT_PATH))
                 {
                    return getWorkspaceDataSizeDirectly();
                 }
  
                 return calculateNodeDataSizeTool.getNodeDataSizeDirectly(nodePath);
              }
           });
        }
        catch (PrivilegedActionException e)
        {
           throw new QuotaManagerException(e.getMessage(), e);
        }
     }
docs: Calculates node data size by asking directly respective {@link WorkspacePersistentDataManager}.