home *** CD-ROM | disk | FTP | other *** search
/ Macwelt 4 / Macwelt DVD 4.cdr / Entwickler / Mac-OS X / Pantomime / Source / LocalFolderCacheManager.m < prev    next >
MacBinary  |  2002-08-08  |  5.3 KB  |  [□□□□/□□□□]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Ultima 6 (music/ultima6) ext Supported
1% dexvert PC-98 Music (music/pc98Music) ext Unsupported
1% dexvert Amiga E Module (other/amigaEModule) ext Unsupported
1% dexvert ECX module (other/ecxModule) ext Unsupported
1% dexvert Maple Common Binary (other/mapleCommonBinary) ext Unsupported
1% dexvert MacBinary (archive/macBinary) fallback Supported
100% file MacBinary II, inited, Thu Aug 8 17:19:35 2002, modified Thu Aug 8 17:19:35 2002, 4818 bytes "LocalFolderCacheManager.m" , at 0x1352 286 bytes resource default (weak)
99% file data default
100% TrID MacBinary 2 default (weak)
100% dearkID deark: macbinary default
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[□□□□]
macFileCreator[□□□□]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 19 4c 6f 63 61 6c 46 | 6f 6c 64 65 72 43 61 63 |..LocalF|olderCac|
|00000010| 68 65 4d 61 6e 61 67 65 | 72 2e 6d 00 00 00 00 00 |heManage|r.m.....|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 00 00 00 00 00 00 00 | 00 01 00 00 00 00 00 00 |........|........|
|00000050| 00 00 00 00 00 12 d2 00 | 00 01 1e b9 78 90 e7 b9 |........|....x...|
|00000060| 78 90 e7 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |x.......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 d2 61 00 00 |........|.....a..|
|00000080| 2f 2a 0a 2a 2a 20 20 4c | 6f 63 61 6c 46 6f 6c 64 |/*.** L|ocalFold|
|00000090| 65 72 43 61 63 68 65 4d | 61 6e 61 67 65 72 2e 6d |erCacheM|anager.m|
|000000a0| 0a 2a 2a 0a 2a 2a 20 20 | 43 6f 70 79 72 69 67 68 |.**.** |Copyrigh|
|000000b0| 74 20 28 63 29 20 32 30 | 30 31 2c 20 32 30 30 32 |t (c) 20|01, 2002|
|000000c0| 0a 2a 2a 0a 2a 2a 20 20 | 41 75 74 68 6f 72 3a 20 |.**.** |Author: |
|000000d0| 4c 75 64 6f 76 69 63 20 | 4d 61 72 63 6f 74 74 65 |Ludovic |Marcotte|
|000000e0| 20 3c 6c 75 64 6f 76 69 | 63 40 53 6f 70 68 6f 73 | <ludovi|c@Sophos|
|000000f0| 2e 63 61 3e 0a 2a 2a 0a | 2a 2a 20 20 54 68 69 73 |.ca>.**.|** This|
|00000100| 20 6c 69 62 72 61 72 79 | 20 69 73 20 66 72 65 65 | library| is free|
|00000110| 20 73 6f 66 74 77 61 72 | 65 3b 20 79 6f 75 20 63 | softwar|e; you c|
|00000120| 61 6e 20 72 65 64 69 73 | 74 72 69 62 75 74 65 20 |an redis|tribute |
|00000130| 69 74 20 61 6e 64 2f 6f | 72 0a 2a 2a 20 20 6d 6f |it and/o|r.** mo|
|00000140| 64 69 66 79 20 69 74 20 | 75 6e 64 65 72 20 74 68 |dify it |under th|
|00000150| 65 20 74 65 72 6d 73 20 | 6f 66 20 74 68 65 20 47 |e terms |of the G|
|00000160| 4e 55 20 4c 65 73 73 65 | 72 20 47 65 6e 65 72 61 |NU Lesse|r Genera|
|00000170| 6c 20 50 75 62 6c 69 63 | 0a 2a 2a 20 20 4c 69 63 |l Public|.** Lic|
|00000180| 65 6e 73 65 20 61 73 20 | 70 75 62 6c 69 73 68 65 |ense as |publishe|
|00000190| 64 20 62 79 20 74 68 65 | 20 46 72 65 65 20 53 6f |d by the| Free So|
|000001a0| 66 74 77 61 72 65 20 46 | 6f 75 6e 64 61 74 69 6f |ftware F|oundatio|
|000001b0| 6e 3b 20 65 69 74 68 65 | 72 0a 2a 2a 20 20 76 65 |n; eithe|r.** ve|
|000001c0| 72 73 69 6f 6e 20 32 2e | 31 20 6f 66 20 74 68 65 |rsion 2.|1 of the|
|000001d0| 20 4c 69 63 65 6e 73 65 | 2c 20 6f 72 20 28 61 74 | License|, or (at|
|000001e0| 20 79 6f 75 72 20 6f 70 | 74 69 6f 6e 29 20 61 6e | your op|tion) an|
|000001f0| 79 20 6c 61 74 65 72 20 | 76 65 72 73 69 6f 6e 2e |y later |version.|
|00000200| 0a 2a 2a 20 20 0a 2a 2a | 20 20 54 68 69 73 20 6c |.** .**| This l|
|00000210| 69 62 72 61 72 79 20 69 | 73 20 64 69 73 74 72 69 |ibrary i|s distri|
|00000220| 62 75 74 65 64 20 69 6e | 20 74 68 65 20 68 6f 70 |buted in| the hop|
|00000230| 65 20 74 68 61 74 20 69 | 74 20 77 69 6c 6c 20 62 |e that i|t will b|
|00000240| 65 20 75 73 65 66 75 6c | 2c 0a 2a 2a 20 20 62 75 |e useful|,.** bu|
|00000250| 74 20 57 49 54 48 4f 55 | 54 20 41 4e 59 20 57 41 |t WITHOU|T ANY WA|
|00000260| 52 52 41 4e 54 59 3b 20 | 77 69 74 68 6f 75 74 20 |RRANTY; |without |
|00000270| 65 76 65 6e 20 74 68 65 | 20 69 6d 70 6c 69 65 64 |even the| implied|
|00000280| 20 77 61 72 72 61 6e 74 | 79 20 6f 66 0a 2a 2a 20 | warrant|y of.** |
|00000290| 20 4d 45 52 43 48 41 4e | 54 41 42 49 4c 49 54 59 | MERCHAN|TABILITY|
|000002a0| 20 6f 72 20 46 49 54 4e | 45 53 53 20 46 4f 52 20 | or FITN|ESS FOR |
|000002b0| 41 20 50 41 52 54 49 43 | 55 4c 41 52 20 50 55 52 |A PARTIC|ULAR PUR|
|000002c0| 50 4f 53 45 2e 20 53 65 | 65 20 74 68 65 20 47 4e |POSE. Se|e the GN|
|000002d0| 55 0a 2a 2a 20 20 4c 65 | 73 73 65 72 20 47 65 6e |U.** Le|sser Gen|
|000002e0| 65 72 61 6c 20 50 75 62 | 6c 69 63 20 4c 69 63 65 |eral Pub|lic Lice|
|000002f0| 6e 73 65 20 66 6f 72 20 | 6d 6f 72 65 20 64 65 74 |nse for |more det|
|00000300| 61 69 6c 73 2e 0a 2a 2a | 20 20 0a 2a 2a 20 20 59 |ails..**| .** Y|
|00000310| 6f 75 20 73 68 6f 75 6c | 64 20 68 61 76 65 20 72 |ou shoul|d have r|
|00000320| 65 63 65 69 76 65 64 20 | 61 20 63 6f 70 79 20 6f |eceived |a copy o|
|00000330| 66 20 74 68 65 20 47 4e | 55 20 4c 65 73 73 65 72 |f the GN|U Lesser|
|00000340| 20 47 65 6e 65 72 61 6c | 20 50 75 62 6c 69 63 0a | General| Public.|
|00000350| 2a 2a 20 20 4c 69 63 65 | 6e 73 65 20 61 6c 6f 6e |** Lice|nse alon|
|00000360| 67 20 77 69 74 68 20 74 | 68 69 73 20 6c 69 62 72 |g with t|his libr|
|00000370| 61 72 79 3b 20 69 66 20 | 6e 6f 74 2c 20 77 72 69 |ary; if |not, wri|
|00000380| 74 65 20 74 6f 20 74 68 | 65 20 46 72 65 65 20 53 |te to th|e Free S|
|00000390| 6f 66 74 77 61 72 65 0a | 2a 2a 20 20 46 6f 75 6e |oftware.|** Foun|
|000003a0| 64 61 74 69 6f 6e 2c 20 | 49 6e 63 2e 2c 20 35 39 |dation, |Inc., 59|
|000003b0| 20 54 65 6d 70 6c 65 20 | 50 6c 61 63 65 2c 20 53 | Temple |Place, S|
|000003c0| 75 69 74 65 20 33 33 30 | 2c 20 42 6f 73 74 6f 6e |uite 330|, Boston|
|000003d0| 2c 20 4d 41 20 30 32 31 | 31 31 2d 31 33 30 37 20 |, MA 021|11-1307 |
|000003e0| 55 53 41 0a 2a 2f 0a 0a | 23 69 6d 70 6f 72 74 20 |USA.*/..|#import |
|000003f0| 3c 50 61 6e 74 6f 6d 69 | 6d 65 2f 4c 6f 63 61 6c |<Pantomi|me/Local|
|00000400| 46 6f 6c 64 65 72 43 61 | 63 68 65 4d 61 6e 61 67 |FolderCa|cheManag|
|00000410| 65 72 2e 68 3e 0a 0a 23 | 69 6d 70 6f 72 74 20 3c |er.h>..#|import <|
|00000420| 50 61 6e 74 6f 6d 69 6d | 65 2f 43 6f 6e 73 74 61 |Pantomim|e/Consta|
|00000430| 6e 74 73 2e 68 3e 0a 23 | 69 6d 70 6f 72 74 20 3c |nts.h>.#|import <|
|00000440| 50 61 6e 74 6f 6d 69 6d | 65 2f 4c 6f 63 61 6c 46 |Pantomim|e/LocalF|
|00000450| 6f 6c 64 65 72 2e 68 3e | 0a 23 69 6d 70 6f 72 74 |older.h>|.#import|
|00000460| 20 3c 50 61 6e 74 6f 6d | 69 6d 65 2f 4c 6f 63 61 | <Pantom|ime/Loca|
|00000470| 6c 4d 65 73 73 61 67 65 | 2e 68 3e 0a 0a 40 69 6d |lMessage|.h>..@im|
|00000480| 70 6c 65 6d 65 6e 74 61 | 74 69 6f 6e 20 4c 6f 63 |plementa|tion Loc|
|00000490| 61 6c 46 6f 6c 64 65 72 | 43 61 63 68 65 4d 61 6e |alFolder|CacheMan|
|000004a0| 61 67 65 72 0a 0a 2d 20 | 28 69 64 29 20 69 6e 69 |ager..- |(id) ini|
|000004b0| 74 0a 7b 0a 20 20 73 65 | 6c 66 20 3d 20 5b 73 75 |t.{. se|lf = [su|
|000004c0| 70 65 72 20 69 6e 69 74 | 5d 3b 0a 20 20 0a 20 20 |per init|];. . |
|000004d0| 6d 65 73 73 61 67 65 73 | 20 3d 20 5b 5b 4e 53 4d |messages| = [[NSM|
|000004e0| 75 74 61 62 6c 65 41 72 | 72 61 79 20 61 6c 6c 6f |utableAr|ray allo|
|000004f0| 63 5d 20 69 6e 69 74 5d | 3b 0a 20 20 0a 20 20 5b |c] init]|;. . [|
|00000500| 73 65 6c 66 20 73 65 74 | 4d 6f 64 69 66 69 63 61 |self set|Modifica|
|00000510| 74 69 6f 6e 44 61 74 65 | 3a 20 5b 4e 53 44 61 74 |tionDate|: [NSDat|
|00000520| 65 20 64 61 74 65 5d 5d | 3b 0a 20 20 5b 73 65 6c |e date]]|;. [sel|
|00000530| 66 20 73 65 74 46 69 6c | 65 53 69 7a 65 3a 20 30 |f setFil|eSize: 0|
|00000540| 5d 3b 0a 0a 20 20 72 65 | 74 75 72 6e 20 73 65 6c |];.. re|turn sel|
|00000550| 66 3b 0a 7d 0a 0a 2d 20 | 28 69 64 29 20 69 6e 69 |f;.}..- |(id) ini|
|00000560| 74 57 69 74 68 50 61 74 | 68 3a 20 28 4e 53 53 74 |tWithPat|h: (NSSt|
|00000570| 72 69 6e 67 20 2a 29 20 | 74 68 65 50 61 74 68 0a |ring *) |thePath.|
|00000580| 7b 0a 20 20 73 65 6c 66 | 20 3d 20 5b 73 65 6c 66 |{. self| = [self|
|00000590| 20 69 6e 69 74 5d 3b 0a | 20 20 0a 20 20 5b 73 65 | init];.| . [se|
|000005a0| 6c 66 20 73 65 74 50 61 | 74 68 54 6f 43 61 63 68 |lf setPa|thToCach|
|000005b0| 65 3a 20 74 68 65 50 61 | 74 68 5d 3b 0a 0a 20 20 |e: thePa|th];.. |
|000005c0| 72 65 74 75 72 6e 20 73 | 65 6c 66 3b 0a 7d 0a 0a |return s|elf;.}..|
|000005d0| 0a 2d 20 28 76 6f 69 64 | 29 20 64 65 61 6c 6c 6f |.- (void|) deallo|
|000005e0| 63 0a 7b 0a 20 20 2f 2f | 4e 53 44 65 62 75 67 4c |c.{. //|NSDebugL|
|000005f0| 6f 67 28 40 22 4c 6f 63 | 61 6c 46 6f 6c 64 65 72 |og(@"Loc|alFolder|
|00000600| 43 61 63 68 65 4d 61 6e | 61 67 65 72 3a 20 2d 64 |CacheMan|ager: -d|
|00000610| 65 61 6c 6c 6f 63 22 29 | 3b 0a 0a 20 20 52 45 4c |ealloc")|;.. REL|
|00000620| 45 41 53 45 28 70 61 74 | 68 54 6f 43 61 63 68 65 |EASE(pat|hToCache|
|00000630| 29 3b 0a 20 20 52 45 4c | 45 41 53 45 28 6d 65 73 |);. REL|EASE(mes|
|00000640| 73 61 67 65 73 29 3b 0a | 20 20 52 45 4c 45 41 53 |sages);.| RELEAS|
|00000650| 45 28 6d 6f 64 69 66 69 | 63 61 74 69 6f 6e 44 61 |E(modifi|cationDa|
|00000660| 74 65 29 3b 0a 0a 20 20 | 5b 73 75 70 65 72 20 64 |te);.. |[super d|
|00000670| 65 61 6c 6c 6f 63 5d 3b | 0a 7d 0a 0a 0a 2d 20 28 |ealloc];|.}...- (|
|00000680| 42 4f 4f 4c 29 20 73 79 | 6e 63 68 72 6f 6e 69 7a |BOOL) sy|nchroniz|
|00000690| 65 0a 7b 0a 20 20 4e 53 | 44 69 63 74 69 6f 6e 61 |e.{. NS|Dictiona|
|000006a0| 72 79 20 2a 61 74 74 72 | 69 62 75 74 65 73 3b 0a |ry *attr|ibutes;.|
|000006b0| 0a 20 20 2f 2f 4e 53 44 | 65 62 75 67 4c 6f 67 28 |. //NSD|ebugLog(|
|000006c0| 40 22 4c 6f 63 61 6c 46 | 6f 6c 64 65 72 43 61 63 |@"LocalF|olderCac|
|000006d0| 68 65 4d 61 6e 61 67 65 | 72 3a 20 2d 73 79 6e 63 |heManage|r: -sync|
|000006e0| 68 72 6f 6e 69 7a 65 22 | 29 3b 0a 20 20 0a 20 20 |hronize"|);. . |
|000006f0| 61 74 74 72 69 62 75 74 | 65 73 20 3d 20 5b 5b 4e |attribut|es = [[N|
|00000700| 53 46 69 6c 65 4d 61 6e | 61 67 65 72 20 64 65 66 |SFileMan|ager def|
|00000710| 61 75 6c 74 4d 61 6e 61 | 67 65 72 5d 20 66 69 6c |aultMana|ger] fil|
|00000720| 65 41 74 74 72 69 62 75 | 74 65 73 41 74 50 61 74 |eAttribu|tesAtPat|
|00000730| 68 3a 20 5b 73 65 6c 66 | 20 70 61 74 68 54 6f 46 |h: [self| pathToF|
|00000740| 6f 6c 64 65 72 5d 0a 09 | 09 09 09 09 20 20 20 20 |older]..|.... |
|00000750| 20 20 20 74 72 61 76 65 | 72 73 65 4c 69 6e 6b 3a | trave|rseLink:|
|00000760| 20 59 45 53 5d 3b 0a 20 | 20 0a 20 20 5b 73 65 6c | YES];. | . [sel|
|00000770| 66 20 73 65 74 4d 6f 64 | 69 66 69 63 61 74 69 6f |f setMod|ificatio|
|00000780| 6e 44 61 74 65 3a 20 5b | 61 74 74 72 69 62 75 74 |nDate: [|attribut|
|00000790| 65 73 20 6f 62 6a 65 63 | 74 46 6f 72 4b 65 79 3a |es objec|tForKey:|
|000007a0| 20 4e 53 46 69 6c 65 4d | 6f 64 69 66 69 63 61 74 | NSFileM|odificat|
|000007b0| 69 6f 6e 44 61 74 65 5d | 5d 3b 0a 20 20 5b 73 65 |ionDate]|];. [se|
|000007c0| 6c 66 20 73 65 74 46 69 | 6c 65 53 69 7a 65 3a 20 |lf setFi|leSize: |
|000007d0| 5b 5b 61 74 74 72 69 62 | 75 74 65 73 20 6f 62 6a |[[attrib|utes obj|
|000007e0| 65 63 74 46 6f 72 4b 65 | 79 3a 20 4e 53 46 69 6c |ectForKe|y: NSFil|
|000007f0| 65 53 69 7a 65 5d 20 69 | 6e 74 56 61 6c 75 65 5d |eSize] i|ntValue]|
|00000800| 5d 3b 0a 20 20 0a 20 20 | 72 65 74 75 72 6e 20 5b |];. . |return [|
|00000810| 4e 53 41 72 63 68 69 76 | 65 72 20 61 72 63 68 69 |NSArchiv|er archi|
|00000820| 76 65 52 6f 6f 74 4f 62 | 6a 65 63 74 3a 20 73 65 |veRootOb|ject: se|
|00000830| 6c 66 20 74 6f 46 69 6c | 65 3a 20 5b 73 65 6c 66 |lf toFil|e: [self|
|00000840| 20 70 61 74 68 54 6f 43 | 61 63 68 65 5d 5d 3b 0a | pathToC|ache]];.|
|00000850| 7d 0a 0a 2f 2f 0a 2f 2f | 20 4e 53 43 6f 64 69 6e |}..//.//| NSCodin|
|00000860| 67 20 70 72 6f 74 6f 63 | 6f 6c 0a 2f 2f 0a 0a 2d |g protoc|ol.//..-|
|00000870| 20 28 76 6f 69 64 29 20 | 65 6e 63 6f 64 65 57 69 | (void) |encodeWi|
|00000880| 74 68 43 6f 64 65 72 3a | 20 28 4e 53 43 6f 64 65 |thCoder:| (NSCode|
|00000890| 72 20 2a 29 20 74 68 65 | 43 6f 64 65 72 0a 7b 0a |r *) the|Coder.{.|
|000008a0| 20 20 5b 74 68 65 43 6f | 64 65 72 20 65 6e 63 6f | [theCo|der enco|
|000008b0| 64 65 4f 62 6a 65 63 74 | 3a 20 5b 73 65 6c 66 20 |deObject|: [self |
|000008c0| 6d 6f 64 69 66 69 63 61 | 74 69 6f 6e 44 61 74 65 |modifica|tionDate|
|000008d0| 5d 5d 3b 0a 20 20 5b 74 | 68 65 43 6f 64 65 72 20 |]];. [t|heCoder |
|000008e0| 65 6e 63 6f 64 65 4f 62 | 6a 65 63 74 3a 20 5b 4e |encodeOb|ject: [N|
|000008f0| 53 4e 75 6d 62 65 72 20 | 6e 75 6d 62 65 72 57 69 |SNumber |numberWi|
|00000900| 74 68 49 6e 74 3a 20 5b | 73 65 6c 66 20 66 69 6c |thInt: [|self fil|
|00000910| 65 53 69 7a 65 5d 5d 5d | 3b 0a 20 20 5b 74 68 65 |eSize]]]|;. [the|
|00000920| 43 6f 64 65 72 20 65 6e | 63 6f 64 65 4f 62 6a 65 |Coder en|codeObje|
|00000930| 63 74 3a 20 5b 73 65 6c | 66 20 6d 65 73 73 61 67 |ct: [sel|f messag|
|00000940| 65 73 5d 5d 3b 0a 7d 0a | 0a 2d 20 28 69 64 29 20 |es]];.}.|.- (id) |
|00000950| 69 6e 69 74 57 69 74 68 | 43 6f 64 65 72 3a 20 28 |initWith|Coder: (|
|00000960| 4e 53 43 6f 64 65 72 20 | 2a 29 20 74 68 65 43 6f |NSCoder |*) theCo|
|00000970| 64 65 72 0a 7b 0a 20 20 | 73 65 6c 66 20 3d 20 5b |der.{. |self = [|
|00000980| 73 75 70 65 72 20 69 6e | 69 74 5d 3b 20 0a 20 20 |super in|it]; . |
|00000990| 0a 20 20 5b 73 65 6c 66 | 20 73 65 74 4d 6f 64 69 |. [self| setModi|
|000009a0| 66 69 63 61 74 69 6f 6e | 44 61 74 65 3a 20 5b 74 |fication|Date: [t|
|000009b0| 68 65 43 6f 64 65 72 20 | 64 65 63 6f 64 65 4f 62 |heCoder |decodeOb|
|000009c0| 6a 65 63 74 5d 5d 3b 0a | 20 20 5b 73 65 6c 66 20 |ject]];.| [self |
|000009d0| 73 65 74 46 69 6c 65 53 | 69 7a 65 3a 20 5b 5b 74 |setFileS|ize: [[t|
|000009e0| 68 65 43 6f 64 65 72 20 | 64 65 63 6f 64 65 4f 62 |heCoder |decodeOb|
|000009f0| 6a 65 63 74 5d 20 69 6e | 74 56 61 6c 75 65 5d 5d |ject] in|tValue]]|
|00000a00| 3b 0a 20 20 5b 73 65 6c | 66 20 73 65 74 4d 65 73 |;. [sel|f setMes|
|00000a10| 73 61 67 65 73 3a 20 5b | 74 68 65 43 6f 64 65 72 |sages: [|theCoder|
|00000a20| 20 64 65 63 6f 64 65 4f | 62 6a 65 63 74 5d 5d 3b | decodeO|bject]];|
|00000a30| 0a 20 20 0a 20 20 72 65 | 74 75 72 6e 20 73 65 6c |. . re|turn sel|
|00000a40| 66 3b 0a 7d 0a 0a 0a 2f | 2f 0a 2f 2f 20 61 63 63 |f;.}.../|/.// acc|
|00000a50| 65 73 73 2f 6d 75 74 61 | 74 69 6f 6e 20 6d 65 74 |ess/muta|tion met|
|00000a60| 68 6f 64 73 0a 2f 2f 0a | 0a 2d 20 28 4e 53 44 61 |hods.//.|.- (NSDa|
|00000a70| 74 65 20 2a 29 20 6d 6f | 64 69 66 69 63 61 74 69 |te *) mo|dificati|
|00000a80| 6f 6e 44 61 74 65 0a 7b | 0a 20 20 72 65 74 75 72 |onDate.{|. retur|
|00000a90| 6e 20 6d 6f 64 69 66 69 | 63 61 74 69 6f 6e 44 61 |n modifi|cationDa|
|00000aa0| 74 65 3b 0a 7d 0a 0a 2d | 20 28 76 6f 69 64 29 20 |te;.}..-| (void) |
|00000ab0| 73 65 74 4d 6f 64 69 66 | 69 63 61 74 69 6f 6e 44 |setModif|icationD|
|00000ac0| 61 74 65 3a 20 28 4e 53 | 44 61 74 65 20 2a 29 20 |ate: (NS|Date *) |
|00000ad0| 74 68 65 44 61 74 65 0a | 7b 0a 20 20 52 45 54 41 |theDate.|{. RETA|
|00000ae0| 49 4e 28 74 68 65 44 61 | 74 65 29 3b 0a 20 20 52 |IN(theDa|te);. R|
|00000af0| 45 4c 45 41 53 45 28 6d | 6f 64 69 66 69 63 61 74 |ELEASE(m|odificat|
|00000b00| 69 6f 6e 44 61 74 65 29 | 3b 0a 20 20 6d 6f 64 69 |ionDate)|;. modi|
|00000b10| 66 69 63 61 74 69 6f 6e | 44 61 74 65 20 3d 20 74 |fication|Date = t|
|00000b20| 68 65 44 61 74 65 3b 0a | 7d 0a 0a 2d 20 28 69 6e |heDate;.|}..- (in|
|00000b30| 74 29 20 66 69 6c 65 53 | 69 7a 65 0a 7b 0a 20 20 |t) fileS|ize.{. |
|00000b40| 72 65 74 75 72 6e 20 66 | 69 6c 65 53 69 7a 65 3b |return f|ileSize;|
|00000b50| 0a 7d 0a 0a 2d 20 28 76 | 6f 69 64 29 20 73 65 74 |.}..- (v|oid) set|
|00000b60| 46 69 6c 65 53 69 7a 65 | 3a 20 28 69 6e 74 29 20 |FileSize|: (int) |
|00000b70| 74 68 65 53 69 7a 65 0a | 7b 0a 20 20 66 69 6c 65 |theSize.|{. file|
|00000b80| 53 69 7a 65 20 3d 20 74 | 68 65 53 69 7a 65 3b 0a |Size = t|heSize;.|
|00000b90| 7d 0a 0a 2d 20 28 76 6f | 69 64 29 20 61 64 64 4d |}..- (vo|id) addM|
|00000ba0| 65 73 73 61 67 65 3a 20 | 28 4c 6f 63 61 6c 4d 65 |essage: |(LocalMe|
|00000bb0| 73 73 61 67 65 20 2a 29 | 20 74 68 65 4d 65 73 73 |ssage *)| theMess|
|00000bc0| 61 67 65 0a 7b 0a 20 20 | 2f 2f 4e 53 44 65 62 75 |age.{. |//NSDebu|
|00000bd0| 67 4c 6f 67 28 40 22 41 | 64 64 69 6e 67 20 61 20 |gLog(@"A|dding a |
|00000be0| 6d 65 73 73 61 67 65 20 | 74 6f 20 74 68 65 20 63 |message |to the c|
|00000bf0| 61 63 68 65 2e 2e 2e 22 | 29 3b 0a 20 20 69 66 20 |ache..."|);. if |
|00000c00| 28 20 74 68 65 4d 65 73 | 73 61 67 65 20 29 0a 20 |( theMes|sage ). |
|00000c10| 20 20 20 7b 0a 20 20 20 | 20 20 20 5b 6d 65 73 73 | {. | [mess|
|00000c20| 61 67 65 73 20 61 64 64 | 4f 62 6a 65 63 74 3a 20 |ages add|Object: |
|00000c30| 74 68 65 4d 65 73 73 61 | 67 65 5d 3b 0a 20 20 20 |theMessa|ge];. |
|00000c40| 20 7d 0a 20 20 65 6c 73 | 65 0a 20 20 20 20 7b 0a | }. els|e. {.|
|00000c50| 20 20 20 20 20 20 4e 53 | 44 65 62 75 67 4c 6f 67 | NS|DebugLog|
|00000c60| 28 40 22 45 72 72 6f 72 | 20 69 6e 20 4c 6f 63 61 |(@"Error| in Loca|
|00000c70| 6c 46 6f 6c 64 65 72 43 | 61 63 68 65 4d 61 6e 61 |lFolderC|acheMana|
|00000c80| 67 65 72 3a 20 2d 61 64 | 64 4d 65 73 73 61 67 65 |ger: -ad|dMessage|
|00000c90| 2e 20 41 74 74 65 6d 70 | 74 65 64 20 74 6f 20 61 |. Attemp|ted to a|
|00000ca0| 64 64 20 61 20 6e 69 6c | 2e 22 29 3b 0a 20 20 20 |dd a nil|.");. |
|00000cb0| 20 7d 0a 7d 0a 0a 2d 20 | 28 76 6f 69 64 29 20 72 | }.}..- |(void) r|
|00000cc0| 65 6d 6f 76 65 4d 65 73 | 73 61 67 65 3a 20 28 4c |emoveMes|sage: (L|
|00000cd0| 6f 63 61 6c 4d 65 73 73 | 61 67 65 20 2a 29 20 74 |ocalMess|age *) t|
|00000ce0| 68 65 4d 65 73 73 61 67 | 65 0a 7b 0a 20 20 69 66 |heMessag|e.{. if|
|00000cf0| 20 28 20 74 68 65 4d 65 | 73 73 61 67 65 20 29 0a | ( theMe|ssage ).|
|00000d00| 20 20 20 20 7b 0a 20 20 | 20 20 20 20 5b 6d 65 73 | {. | [mes|
|00000d10| 73 61 67 65 73 20 72 65 | 6d 6f 76 65 4f 62 6a 65 |sages re|moveObje|
|00000d20| 63 74 3a 20 74 68 65 4d | 65 73 73 61 67 65 5d 3b |ct: theM|essage];|
|00000d30| 0a 20 20 20 20 7d 0a 20 | 20 65 6c 73 65 0a 20 20 |. }. | else. |
|00000d40| 20 20 7b 0a 20 20 20 20 | 20 20 4e 53 44 65 62 75 | {. | NSDebu|
|00000d50| 67 4c 6f 67 28 40 22 45 | 72 72 6f 72 20 69 6e 20 |gLog(@"E|rror in |
|00000d60| 4c 6f 63 61 6c 46 6f 6c | 64 65 72 43 61 63 68 65 |LocalFol|derCache|
|00000d70| 4d 61 6e 61 67 65 72 3a | 20 2d 72 65 6d 6f 76 65 |Manager:| -remove|
|00000d80| 4d 65 73 73 61 67 65 2e | 20 41 74 74 65 6d 70 74 |Message.| Attempt|
|00000d90| 65 64 20 74 6f 20 72 65 | 6d 6f 76 65 20 61 20 6e |ed to re|move a n|
|00000da0| 69 6c 2e 22 29 3b 0a 20 | 20 20 20 7d 0a 7d 0a 0a |il.");. | }.}..|
|00000db0| 2d 20 28 4e 53 41 72 72 | 61 79 20 2a 29 20 6d 65 |- (NSArr|ay *) me|
|00000dc0| 73 73 61 67 65 73 0a 7b | 0a 20 20 72 65 74 75 72 |ssages.{|. retur|
|00000dd0| 6e 20 6d 65 73 73 61 67 | 65 73 3b 0a 7d 0a 0a 2d |n messag|es;.}..-|
|00000de0| 20 28 76 6f 69 64 29 20 | 73 65 74 4d 65 73 73 61 | (void) |setMessa|
|00000df0| 67 65 73 3a 20 28 4e 53 | 41 72 72 61 79 20 2a 29 |ges: (NS|Array *)|
|00000e00| 20 74 68 65 4d 65 73 73 | 61 67 65 73 0a 7b 0a 20 | theMess|ages.{. |
|00000e10| 20 69 66 20 28 20 74 68 | 65 4d 65 73 73 61 67 65 | if ( th|eMessage|
|00000e20| 73 20 29 0a 20 20 20 20 | 7b 0a 20 20 20 20 20 20 |s ). |{. |
|00000e30| 52 45 4c 45 41 53 45 28 | 6d 65 73 73 61 67 65 73 |RELEASE(|messages|
|00000e40| 29 3b 0a 20 20 20 20 20 | 20 6d 65 73 73 61 67 65 |);. | message|
|00000e50| 73 20 3d 20 5b 5b 4e 53 | 4d 75 74 61 62 6c 65 41 |s = [[NS|MutableA|
|00000e60| 72 72 61 79 20 61 6c 6c | 6f 63 5d 20 69 6e 69 74 |rray all|oc] init|
|00000e70| 57 69 74 68 41 72 72 61 | 79 3a 20 74 68 65 4d 65 |WithArra|y: theMe|
|00000e80| 73 73 61 67 65 73 5d 3b | 0a 20 20 20 20 7d 0a 20 |ssages];|. }. |
|00000e90| 20 65 6c 73 65 0a 20 20 | 20 20 7b 0a 20 20 20 20 | else. | {. |
|00000ea0| 20 20 52 45 4c 45 41 53 | 45 28 6d 65 73 73 61 67 | RELEAS|E(messag|
|00000eb0| 65 73 29 3b 0a 20 20 20 | 20 20 20 6d 65 73 73 61 |es);. | messa|
|00000ec0| 67 65 73 20 3d 20 6e 69 | 6c 3b 0a 20 20 20 20 7d |ges = ni|l;. }|
|00000ed0| 0a 7d 0a 0a 0a 2d 20 28 | 4e 53 53 74 72 69 6e 67 |.}...- (|NSString|
|00000ee0| 20 2a 29 20 70 61 74 68 | 54 6f 43 61 63 68 65 0a | *) path|ToCache.|
|00000ef0| 7b 0a 20 20 72 65 74 75 | 72 6e 20 70 61 74 68 54 |{. retu|rn pathT|
|00000f00| 6f 43 61 63 68 65 3b 0a | 7d 0a 0a 2d 20 28 76 6f |oCache;.|}..- (vo|
|00000f10| 69 64 29 20 73 65 74 50 | 61 74 68 54 6f 43 61 63 |id) setP|athToCac|
|00000f20| 68 65 3a 20 28 4e 53 53 | 74 72 69 6e 67 20 2a 29 |he: (NSS|tring *)|
|00000f30| 20 74 68 65 50 61 74 68 | 54 6f 43 61 63 68 65 0a | thePath|ToCache.|
|00000f40| 7b 0a 20 20 52 45 54 41 | 49 4e 28 74 68 65 50 61 |{. RETA|IN(thePa|
|00000f50| 74 68 54 6f 43 61 63 68 | 65 29 3b 0a 20 20 52 45 |thToCach|e);. RE|
|00000f60| 4c 45 41 53 45 28 70 61 | 74 68 54 6f 43 61 63 68 |LEASE(pa|thToCach|
|00000f70| 65 29 3b 0a 20 20 70 61 | 74 68 54 6f 43 61 63 68 |e);. pa|thToCach|
|00000f80| 65 20 3d 20 74 68 65 50 | 61 74 68 54 6f 43 61 63 |e = theP|athToCac|
|00000f90| 68 65 3b 0a 7d 0a 0a 0a | 2d 20 28 4e 53 53 74 72 |he;.}...|- (NSStr|
|00000fa0| 69 6e 67 20 2a 29 20 70 | 61 74 68 54 6f 46 6f 6c |ing *) p|athToFol|
|00000fb0| 64 65 72 0a 7b 0a 20 20 | 72 65 74 75 72 6e 20 70 |der.{. |return p|
|00000fc0| 61 74 68 54 6f 46 6f 6c | 64 65 72 3b 0a 7d 0a 0a |athToFol|der;.}..|
|00000fd0| 0a 2f 2f 0a 2f 2f 20 57 | 65 20 64 6f 6e 27 74 20 |.//.// W|e don't |
|00000fe0| 6e 65 65 64 20 74 6f 20 | 72 65 74 61 69 6e 20 74 |need to |retain t|
|00000ff0| 68 69 73 20 69 76 61 72 | 20 73 69 6e 63 65 20 69 |his ivar| since i|
|00001000| 74 27 73 20 72 65 74 61 | 69 6e 65 64 20 69 6e 20 |t's reta|ined in |
|00001010| 74 68 65 20 66 6f 6c 64 | 65 72 20 6f 62 6a 65 63 |the fold|er objec|
|00001020| 74 0a 2f 2f 20 61 6c 72 | 65 61 64 79 2e 0a 2f 2f |t.// alr|eady..//|
|00001030| 0a 2d 20 28 76 6f 69 64 | 29 20 73 65 74 50 61 74 |.- (void|) setPat|
|00001040| 68 54 6f 46 6f 6c 64 65 | 72 3a 20 28 4e 53 53 74 |hToFolde|r: (NSSt|
|00001050| 72 69 6e 67 20 2a 29 20 | 74 68 65 50 61 74 68 54 |ring *) |thePathT|
|00001060| 6f 46 6f 6c 64 65 72 0a | 7b 0a 20 20 70 61 74 68 |oFolder.|{. path|
|00001070| 54 6f 46 6f 6c 64 65 72 | 20 3d 20 74 68 65 50 61 |ToFolder| = thePa|
|00001080| 74 68 54 6f 46 6f 6c 64 | 65 72 3b 0a 7d 0a 0a 2f |thToFold|er;.}../|
|00001090| 2f 0a 2f 2f 20 4f 74 68 | 65 72 20 6d 65 74 68 6f |/.// Oth|er metho|
|000010a0| 64 73 0a 2f 2f 0a 2d 20 | 28 76 6f 69 64 29 20 69 |ds.//.- |(void) i|
|000010b0| 6e 76 61 6c 69 64 61 74 | 65 0a 7b 0a 20 20 5b 6d |nvalidat|e.{. [m|
|000010c0| 65 73 73 61 67 65 73 20 | 72 65 6d 6f 76 65 41 6c |essages |removeAl|
|000010d0| 6c 4f 62 6a 65 63 74 73 | 5d 3b 0a 7d 0a 0a 0a 2f |lObjects|];.}.../|
|000010e0| 2f 0a 2f 2f 20 63 6c 61 | 73 73 20 6d 65 74 68 6f |/.// cla|ss metho|
|000010f0| 64 73 0a 2f 2f 0a 2b 20 | 28 69 64 29 20 6c 6f 63 |ds.//.+ |(id) loc|
|00001100| 61 6c 46 6f 6c 64 65 72 | 43 61 63 68 65 46 72 6f |alFolder|CacheFro|
|00001110| 6d 44 69 73 6b 57 69 74 | 68 50 61 74 68 3a 20 28 |mDiskWit|hPath: (|
|00001120| 4e 53 53 74 72 69 6e 67 | 20 2a 29 20 74 68 65 50 |NSString| *) theP|
|00001130| 61 74 68 3b 0a 7b 0a 20 | 20 4c 6f 63 61 6c 46 6f |ath;.{. | LocalFo|
|00001140| 6c 64 65 72 43 61 63 68 | 65 4d 61 6e 61 67 65 72 |lderCach|eManager|
|00001150| 20 2a 61 4c 6f 63 61 6c | 46 6f 6c 64 65 72 43 61 | *aLocal|FolderCa|
|00001160| 63 68 65 4d 61 6e 61 67 | 65 72 3b 0a 0a 20 20 61 |cheManag|er;.. a|
|00001170| 4c 6f 63 61 6c 46 6f 6c | 64 65 72 43 61 63 68 65 |LocalFol|derCache|
|00001180| 4d 61 6e 61 67 65 72 20 | 3d 20 5b 4e 53 55 6e 61 |Manager |= [NSUna|
|00001190| 72 63 68 69 76 65 72 20 | 75 6e 61 72 63 68 69 76 |rchiver |unarchiv|
|000011a0| 65 4f 62 6a 65 63 74 57 | 69 74 68 46 69 6c 65 3a |eObjectW|ithFile:|
|000011b0| 20 74 68 65 50 61 74 68 | 20 5d 3b 0a 20 20 0a 20 | thePath| ];. . |
|000011c0| 20 69 66 20 28 20 61 4c | 6f 63 61 6c 46 6f 6c 64 | if ( aL|ocalFold|
|000011d0| 65 72 43 61 63 68 65 4d | 61 6e 61 67 65 72 20 29 |erCacheM|anager )|
|000011e0| 0a 20 20 20 20 7b 0a 20 | 20 20 20 20 20 4e 53 44 |. {. | NSD|
|000011f0| 65 62 75 67 4c 6f 67 28 | 40 22 55 73 69 6e 67 20 |ebugLog(|@"Using |
|00001200| 65 78 69 73 74 69 6e 67 | 20 63 6f 70 79 20 6f 66 |existing| copy of|
|00001210| 20 74 68 65 20 63 61 63 | 68 65 2e 22 29 3b 0a 20 | the cac|he.");. |
|00001220| 20 20 20 20 20 5b 61 4c | 6f 63 61 6c 46 6f 6c 64 | [aL|ocalFold|
|00001230| 65 72 43 61 63 68 65 4d | 61 6e 61 67 65 72 20 73 |erCacheM|anager s|
|00001240| 65 74 50 61 74 68 54 6f | 43 61 63 68 65 3a 20 74 |etPathTo|Cache: t|
|00001250| 68 65 50 61 74 68 5d 3b | 0a 20 20 20 20 7d 0a 20 |hePath];|. }. |
|00001260| 20 65 6c 73 65 0a 20 20 | 20 20 7b 0a 20 20 20 20 | else. | {. |
|00001270| 20 20 4e 53 44 65 62 75 | 67 4c 6f 67 28 40 22 43 | NSDebu|gLog(@"C|
|00001280| 72 65 61 74 69 6e 67 20 | 6e 65 77 20 63 61 63 68 |reating |new cach|
|00001290| 65 2e 22 29 3b 0a 20 20 | 20 20 20 20 61 4c 6f 63 |e.");. | aLoc|
|000012a0| 61 6c 46 6f 6c 64 65 72 | 43 61 63 68 65 4d 61 6e |alFolder|CacheMan|
|000012b0| 61 67 65 72 20 3d 20 5b | 5b 4c 6f 63 61 6c 46 6f |ager = [|[LocalFo|
|000012c0| 6c 64 65 72 43 61 63 68 | 65 4d 61 6e 61 67 65 72 |lderCach|eManager|
|000012d0| 20 61 6c 6c 6f 63 5d 20 | 69 6e 69 74 57 69 74 68 | alloc] |initWith|
|000012e0| 50 61 74 68 3a 20 74 68 | 65 50 61 74 68 5d 3b 0a |Path: th|ePath];.|
|000012f0| 20 20 20 20 20 20 41 55 | 54 4f 52 45 4c 45 41 53 | AU|TORELEAS|
|00001300| 45 28 61 4c 6f 63 61 6c | 46 6f 6c 64 65 72 43 61 |E(aLocal|FolderCa|
|00001310| 63 68 65 4d 61 6e 61 67 | 65 72 29 3b 0a 20 20 20 |cheManag|er);. |
|00001320| 20 7d 0a 20 20 0a 20 20 | 72 65 74 75 72 6e 20 61 | }. . |return a|
|00001330| 4c 6f 63 61 6c 46 6f 6c | 64 65 72 43 61 63 68 65 |LocalFol|derCache|
|00001340| 4d 61 6e 61 67 65 72 3b | 0a 7d 0a 0a 0a 40 65 6e |Manager;|.}...@en|
|00001350| 64 0a 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |d.......|........|
|00001360| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001370| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001380| 00 00 01 00 00 00 01 00 | 00 00 00 00 00 00 00 1e |........|........|
|00001390| 54 68 69 73 20 72 65 73 | 6f 75 72 63 65 20 66 6f |This res|ource fo|
|000013a0| 72 6b 20 69 6e 74 65 6e | 74 69 6f 6e 61 6c 6c 79 |rk inten|tionally|
|000013b0| 20 6c 65 66 74 20 62 6c | 61 6e 6b 20 20 20 00 00 | left bl|ank ..|
|000013c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000013d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000013e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000013f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001400| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001410| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001420| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001430| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001440| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001450| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001460| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001470| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001480| 00 00 01 00 00 00 01 00 | 00 00 00 00 00 00 00 1e |........|........|
|00001490| 00 00 00 00 00 00 00 00 | 00 1c 00 1e ff ff 00 00 |........|........|
|000014a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000014b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000014c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000014d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000014e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000014f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+