File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed
commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/http4 Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -48,24 +48,18 @@ public Http4FileContentInfoFactory() {
4848 @ SuppressWarnings ("unchecked" )
4949 @ Override
5050 public FileContentInfo create (final FileContent fileContent ) throws FileSystemException {
51- String contentMimeType = null ;
52- String contentCharset = null ;
53-
54- try (Http4FileObject <Http4FileSystem > http4File = (Http4FileObject <Http4FileSystem >) FileObjectUtils
55- .getAbstractFileObject (fileContent .getFile ())) {
51+ try (Http4FileObject <Http4FileSystem > http4File = (Http4FileObject <Http4FileSystem >) FileObjectUtils .getAbstractFileObject (fileContent .getFile ())) {
5652 final HttpResponse lastHeadResponse = http4File .getLastHeadResponse ();
57-
5853 final Header header = lastHeadResponse .getFirstHeader (HTTP .CONTENT_TYPE );
59-
54+ String contentMimeType = null ;
55+ String contentCharset = null ;
6056 if (header != null ) {
6157 final ContentType contentType = ContentType .parse (header .getValue ());
6258 contentMimeType = contentType .getMimeType ();
63-
6459 if (contentType .getCharset () != null ) {
6560 contentCharset = contentType .getCharset ().name ();
6661 }
6762 }
68-
6963 return new DefaultFileContentInfo (contentMimeType , contentCharset );
7064 } catch (final IOException e ) {
7165 throw new FileSystemException (e );
You can’t perform that action at this time.
0 commit comments