#FEATURE by cg
authorClaus Gittinger <cg@exept.de>
Wed, 28 Nov 2018 15:31:45 +0100
changeset 4771 994d4aaf474d
parent 4770 ff398f221e71
child 4772 23aa29691ef0
#FEATURE by cg class: Archiver class changed: #newFor:
Archiver.st
--- a/Archiver.st	Tue Nov 27 16:31:23 2018 +0100
+++ b/Archiver.st	Wed Nov 28 15:31:45 2018 +0100
@@ -221,12 +221,23 @@
 !
 
 newFor:aFilename
-    |fn archiverClass|
+    |fn mimeType archiverClass|
 
     fn := aFilename asFilename.
-    archiverClass := self classForMimeType:fn mimeTypeFromName fileName:fn.
+    (mimeType := fn mimeTypeFromName) isNil ifTrue:[
+        (mimeType := fn mimeTypeOfContents) isNil ifTrue:[
+            self breakPoint:#cg.
+        ].
+    ].        
+    mimeType = 'application/x-zip-compressed' ifTrue:[
+        self breakPoint:#cg.
+    ].
+    
+    archiverClass := self classForMimeType:mimeType fileName:fn.
     archiverClass isNil ifTrue:[^ nil].
     ^ archiverClass with:fn
+
+    "Modified: / 28-11-2018 / 15:31:31 / Claus Gittinger"
 !
 
 with:aFilename