PeterAlfredLee commented on a change in pull request #92:
URL: https://github.com/apache/commons-vfs/pull/92#discussion_r438499177



##########
File path: 
commons-vfs2/src/main/java/org/apache/commons/vfs2/impl/FileTypeMap.java
##########
@@ -57,7 +58,7 @@ public String getScheme(final FileObject file) throws 
FileSystemException {
         // Check the file's mime type for a match
         final FileContent content = file.getContent();
         final String mimeType = content.getContentInfo().getContentType();
-        if (mimeType != null) {
+        if (mimeType != null && !mimeType.equals(MIME_TYPE_OCTET_STREAM)) {

Review comment:
       Not familiar with `mimeType` eithor, seems it's used in Internet media.
   
   According to the [mimeType 
table](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types)
 the `.gz` should be regarded as `application/gzip`, but we got a 
`application/octet-stream` here. Actually I diged a little here and found it's 
caused in `sun.net.www.MimeTable` and will treat extensions `.saveme, .dump, 
.hqx, .arc, .obj, .lib, .bin, .exe, .gz` as `application/octet-stream`.Not sure 
if this is a potential problem of `sun.net.www.MimeTable` or not. 
   
   This is just a workaround for it.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to