code: public static boolean isFile(Node node)
     {
        try
        {
           if (!node.isNodeType("nt:file"))
              return false;
           if (!node.getNode("jcr:content").isNodeType("nt:resource"))
              return false;
           return true;
        }
        catch (RepositoryException exc)
        {
           LOG.error(exc.getMessage(), exc);
           return false;
        }
     }
docs: If the node is file.
  
  @param node node
  @return true if node is file false if not