From 75ea772c42009ba80736f4157b4e815a25baa53a Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Sat, 4 Jun 2011 00:13:43 +0000 Subject: [PATCH] Monotone-Parent: ae1a7958cd81c59ed7bbcddc2a53188885222d07 Monotone-Revision: a3454a89b34b8bb6dd1906bf066c6d929fc08428 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-06-04T00:13:43 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 5 +++++ OpenChange/SOGoMAPIFSFolder.h | 3 +++ OpenChange/SOGoMAPIFSFolder.m | 23 +++++++++++++++++++++++ 3 files changed, 31 insertions(+) diff --git a/ChangeLog b/ChangeLog index 8dd650d32..6cdffaacf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2011-06-03 Wolfgang Sourdeau + * OpenChange/SOGoMAPIFSFolder.m (-creationTime) + (-lastModificationTime): new self-explicit accessors. + (-initWithURL:andTableType:): accept the "MAPISTORE_FOLDER_TABLE", + for storing folder properties. + * OpenChange/SOGoMAPIFSMessage.m (-completeFilename): new method that returns the full filename for the property list file. (-appendProperties:) simplified method. diff --git a/OpenChange/SOGoMAPIFSFolder.h b/OpenChange/SOGoMAPIFSFolder.h index ab36dbe58..824519730 100644 --- a/OpenChange/SOGoMAPIFSFolder.h +++ b/OpenChange/SOGoMAPIFSFolder.h @@ -45,6 +45,9 @@ - (SOGoMAPIFSMessage *) newMessage; - (void) ensureDirectory; +- (NSCalendarDate *) creationTime; +- (NSCalendarDate *) lastModificationTime; + @end #endif /* SOGOMAPIFSFOLDER_H */ diff --git a/OpenChange/SOGoMAPIFSFolder.m b/OpenChange/SOGoMAPIFSFolder.m index eaaf2386c..62f9e0ac6 100644 --- a/OpenChange/SOGoMAPIFSFolder.m +++ b/OpenChange/SOGoMAPIFSFolder.m @@ -97,6 +97,8 @@ static NSString *privateDir = nil; tableParticle = @"message"; else if (tableType == MAPISTORE_FAI_TABLE) tableParticle = @"fai"; + else if (tableType == MAPISTORE_FOLDER_TABLE) + tableParticle = @"folder"; else { [NSException raise: @"MAPIStoreIOException" @@ -228,4 +230,25 @@ static NSString *privateDir = nil; return object; } +- (id) _fileAttributeForKey: (NSString *) key +{ + NSDictionary *attributes; + + attributes = [[NSFileManager defaultManager] + fileAttributesAtPath: directory + traverseLink: NO]; + + return [attributes objectForKey: key]; +} + +- (NSCalendarDate *) creationTime +{ + return [self _fileAttributeForKey: NSFileCreationDate]; +} + +- (NSCalendarDate *) lastModificationTime +{ + return [self _fileAttributeForKey: NSFileModificationDate]; +} + @end