getContentType and getContentLength can throw IOException