npe fix for setting content type and length in FileResource