'From Squeak3.7alpha of ''11 September 2003'' [latest update: #5423] on 12 October 2003 at 9:28:33 pm'!
"Change Set:		FIX-BFAV
Date:			12 October 2003
Author:			stephane ducasse

fix the problem that BFAV crashes at open-time when files
with other extensions that .cs or .st 
are in the email directory"!


!EmailFileRepository methodsFor: 'uids' stamp: 'sd 10/12/2003 21:23'!
addServerUrl: aUrlOrString
	
     | serverUrl storageUrl fileNames numbers |
	 
     serverUrl _ aUrlOrString asUrl.
	storageUrl _ self storageUrlFor: serverUrl.
     storageUrlUids at: (storageUrl asString) ifAbsentPut: (SortedCollection sortBlock: [ :a :b | a > b ]).
     self createDirsForUrl: storageUrl.
	fileNames _ self fileNamesForServerUrl: serverUrl.
	fileNames ifNotNil: [
			numbers := 	(fileNames collect: [ :fileName | self class uidFromFileName: fileName]) 							select: [ :e | e notNil ].
			(storageUrlUids at: storageUrl asString) addAll: numbers].
			
     
     ^ storageUrl! !


!EmailFileRepository class methodsFor: 'utilities' stamp: 'sd 10/12/2003 21:15'!
uidFromFileName: aFileName

  aFileName isEmptyOrNil  ifTrue: [ ^ nil ].

  ( aFileName endsWith: '.txt' )
	ifTrue: [ ^ self uidFromTextFileName: aFileName ].

  ( aFileName endsWith: '.cs' )  
	ifTrue: [ ^ self uidFromChangeSetFileName: aFileName ].

   ^ nil
  ! !

