In any action for false arrest, false imprisonment, unlawful detention, defamation of character, assault, trespass or invasion of civil rights brought by any person by reason of having been detained on or in the immediate vicinity of the premises of a public library or association library for the purpose of investigation or questioning as to the ownership of any materials, it shall be a defense to such action that the person was detained in a reasonable manner and for not more than a reasonable time to permit such investigation or questioning by a peace officer or by the librarian in charge, his or her authorized employee or agent, and that such peace officer, librarian, employee or agent has reasonable grounds to believe that the person so detained was committing or attempting to commit larceny on such premises of such materials. As used in this section, "reasonable grounds" shall include, but not be limited to, knowledge that a person has concealed, unauthorized possession of material owned or belonging to the public library or association library, and a "reasonable time" shall mean the time necessary to permit the person detained to make a statement or to refuse to make a statement, and the time necessary to examine employees and records of the public library or association library relative to the ownership of the materials.
N.Y. Educ. Law § 265-A