N.Y. JUD. LAW § 4 : NY Code - Section 4: Sittings of courts to be public

The sittings of every court
  within this state shall be public, and every citizen may  freely  attend
  the  same,  except  that  in  all  proceedings  and  trials in cases for
  divorce, seduction, abortion, rape, assault with intent to commit  rape,
  criminal  sexual  act,  bastardy  or  filiation,  the  court may, in its
  discretion,  exclude  therefrom  all  persons  who  are   not   directly
  interested  therein,  excepting  jurors,  witnesses, and officers of the
  court.