move some static methods from Legacy to File util