public FileContentInfo create(FileContent fileContent) throws FileSystemException { HttpFileObject httpFile = (HttpFileObject) fileContent.getFile(); String contentType = null; String contentEncoding = null; Header header = httpFile.getHeadMethod().getResponseHeader("content-type"); if (header != null) { HeaderElement[] element; try { element = header.getValues(); } catch (HttpException e) { throw new FileSystemException(e); } if (element != null && element.length > 0) { contentType = element[0].getName(); } } contentEncoding = httpFile.getHeadMethod().getResponseCharSet(); return new DefaultFileContentInfo(contentType, contentEncoding); } }