Every application for license shall be retained by the department for a period of three years and shall be confidential information for the use of the department, the attorney general or the prosecuting attorney only: PROVIDED, That upon a showing of good cause therefor any court in which an action is pending by or against the applicant or licensee, may order the director to produce and permit the inspection and copying or photographing the application and any accompanying statements.