public String getContentType(Resource resource) { String extension = TapestryInternalUtils.toFileSuffix(resource.getFile()); String contentType = configuration.get(extension); if (contentType != null) return contentType; contentType = context.getMimeType(resource.getFile()); if (contentType != null) return contentType; return "application/octet-stream"; }