public static HttpResponse staticResource ( final URL resource , final long expiration ) { return new HttpResponse ( ) { public void generateResponse ( StaplerRequest req , StaplerResponse rsp , Object node ) throws IOException , ServletException { rsp . serveFile ( req , resource , expiration ) ; } } ; }
Serves a static resource specified by the URL .