'From etoys4.0 of 9 October 2008 [latest update: #2311] on 16 September 2009 at 11:39:17 am'! "Change Set: assureLastModified-yo Date: 16 September 2009 Author: Yoshiki Ohshima getlastmodified may be empty or malformed."! !DAVServerDirectory methodsFor: 'property access' stamp: 'yo 9/16/2009 11:37'! parsePropertyResponse: response "Answer a DirectoryEntry made from response xml" | childName directoryString propStats aDictionary mtime value dirFlag fileSize contentString unescaped | directoryString := self directory. directoryString first = $/ ifFalse: [directoryString := '/' , directoryString]. directoryString last = $/ ifFalse: [directoryString := directoryString , '/']. contentString := (response elementUnqualifiedAt: 'href') contentString. unescaped := directoryString unescapePercents. contentString size < unescaped size ifTrue: [childName := ''] ifFalse: [childName := contentString allButFirst: unescaped size]. (childName isEmpty not and: [childName last = $/]) ifTrue: [childName := childName allButLast]. childName. propStats := response elements select: [:e | e localName = 'propstat']. aDictionary := Dictionary new. propStats do: [:propStat | (propStat elementUnqualifiedAt: 'prop') ifNotNilDo: [:x | x elements do: [:propElement | value := propElement elements isEmpty ifTrue: [propElement contentString] ifFalse: [propElement elements first localName]. aDictionary at: propElement localName put: value]]]. mtime := fileSize := 0. dirFlag := false. mtime := aDictionary at: #getlastmodified ifPresent: [:v | [(TimeStamp fromString: (v allButFirst: 5)) asSeconds] on: Error do: [:ex | 0]]. dirFlag := aDictionary at: #resourcetype ifPresent: [:v | v = #collection]. fileSize := aDictionary at: #getcontentlength ifPresent: [:v | v asNumber]. ^ DirectoryEntry name: childName unescapePercents creationTime: 0 modificationTime: mtime isDirectory: dirFlag fileSize: fileSize! !