An Erdös-Gallai type theorem for uniform hypergraphs