#FEATURE by cg
authorClaus Gittinger <cg@exept.de>
Tue, 08 Nov 2016 11:26:47 +0100
changeset 4200 089df8914384
parent 4199 a3839426cbcf
child 4201 e29dfac90a57
#FEATURE by cg class: ZipArchive class definition added: #zipFileCachingTime: changed: #installFlushBlock
ZipArchive.st
--- a/ZipArchive.st	Tue Nov 08 09:24:51 2016 +0100
+++ b/ZipArchive.st	Tue Nov 08 11:26:47 2016 +0100
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
 "
  COPYRIGHT (c) 1998 by eXept Software AG
               All Rights Reserved
@@ -19,7 +17,8 @@
 	instanceVariableNames:'file mode archiveName firstEntry lastEntry centralDirectory
 		startOfArchive endOfArchive zipMembersByName appendTrailingSlash'
 	classVariableNames:'RecentlyUsedZipArchives FlushBlock ZipFileFormatErrorSignal
-		UnsupportedZipFileFormatErrorSignal DefaultAppendTrailingSlash'
+		UnsupportedZipFileFormatErrorSignal DefaultAppendTrailingSlash
+		ZipFileCachingTime'
 	poolDictionaries:'ZipArchiveConstants'
 	category:'System-Support-FileFormats'
 !
@@ -2971,6 +2970,14 @@
     DefaultAppendTrailingSlash := aBoolean
 
     "Created: / 19-11-2012 / 11:53:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+zipFileCachingTime:seconds
+    "by default, zip files are cached for some time, 
+     in case they are reconsulted soon.
+     The defualt time is 60s, but can be changed by this setter"
+     
+    ZipFileCachingTime := seconds
 ! !
 
 !ZipArchive class methodsFor:'class initialization'!
@@ -3017,7 +3024,7 @@
     FlushBlock isNil ifTrue:[
         FlushBlock := [RecentlyUsedZipArchives := nil. FlushBlock := nil].
     ].
-    Processor addTimedBlock:FlushBlock for:Processor timeoutHandlerProcess afterSeconds:60.
+    Processor addTimedBlock:FlushBlock for:Processor timeoutHandlerProcess afterSeconds:(ZipFileCachingTime ? 60).
 
     "
      self installFlushBlock