@@ -25,7 +25,7 @@ + (NSURL *)createFileAtPathComponent:(NSString *)filePathComponent
2525 forceOverwrite : (BOOL )forceOverwrite {
2626 @synchronized (self) {
2727 if (filePathComponent) {
28- NSURL *fileURL = [[self appCenterDirectoryURL ] URLByAppendingPathComponent: filePathComponent];
28+ NSURL *fileURL = [[self appCenterDirectoryURL ] URLByAppendingPathComponent: filePathComponent isDirectory: NO ];
2929
3030 // Check if item already exists. We need to check this as writeToURL:atomically: can override an existing file.
3131 if (!forceOverwrite && [fileURL checkResourceIsReachableAndReturnError: nil ]) {
@@ -89,7 +89,7 @@ + (BOOL)deleteFileAtURL:(NSURL *)fileURL {
8989+ (NSURL *)createDirectoryForPathComponent : (NSString *)directoryPathComponent {
9090 @synchronized (self) {
9191 if (directoryPathComponent) {
92- NSURL *subDirURL = [[self appCenterDirectoryURL ] URLByAppendingPathComponent: directoryPathComponent];
92+ NSURL *subDirURL = [[self appCenterDirectoryURL ] URLByAppendingPathComponent: directoryPathComponent isDirectory: YES ];
9393 BOOL success = [self createDirectoryAtURL: subDirURL];
9494 return success ? subDirURL : nil ;
9595 }
@@ -100,7 +100,7 @@ + (NSURL *)createDirectoryForPathComponent:(NSString *)directoryPathComponent {
100100+ (NSData *)loadDataForPathComponent : (NSString *)filePathComponent {
101101 @synchronized (self) {
102102 if (filePathComponent) {
103- NSURL *fileURL = [[self appCenterDirectoryURL ] URLByAppendingPathComponent: filePathComponent];
103+ NSURL *fileURL = [[self appCenterDirectoryURL ] URLByAppendingPathComponent: filePathComponent isDirectory: NO ];
104104 return [NSData dataWithContentsOfURL: fileURL];
105105 }
106106 return nil ;
@@ -133,15 +133,15 @@ + (BOOL)createFileAtPath:(NSString *)filePath contents:(NSData *)data attributes
133133
134134+ (BOOL )fileExistsForPathComponent : (NSString *)filePathComponent {
135135 {
136- NSURL *fileURL = [[self appCenterDirectoryURL ] URLByAppendingPathComponent: filePathComponent];
136+ NSURL *fileURL = [[self appCenterDirectoryURL ] URLByAppendingPathComponent: filePathComponent isDirectory: NO ];
137137 return [fileURL checkResourceIsReachableAndReturnError: nil ];
138138 }
139139}
140140
141141+ (NSURL *)fullURLForPathComponent : (NSString *)filePathComponent {
142142 {
143143 if (filePathComponent) {
144- return [[self appCenterDirectoryURL ] URLByAppendingPathComponent: filePathComponent];
144+ return [[self appCenterDirectoryURL ] URLByAppendingPathComponent: filePathComponent isDirectory: NO ];
145145 }
146146 return nil ;
147147 }
@@ -168,9 +168,9 @@ + (NSURL *)appCenterDirectoryURL {
168168
169169 // Use the application's bundle identifier for macOS to make sure to use separate directories for each app.
170170 NSString *bundleIdentifier = [NSString stringWithFormat: @" %@ /" , [MSAC_APP_MAIN_BUNDLE bundleIdentifier ]];
171- dirURL = [[baseDirUrl URLByAppendingPathComponent: bundleIdentifier] URLByAppendingPathComponent: kMSACAppCenterBundleIdentifier ];
171+ dirURL = [[baseDirUrl URLByAppendingPathComponent: bundleIdentifier isDirectory: YES ] URLByAppendingPathComponent: kMSACAppCenterBundleIdentifier isDirectory: YES ];
172172#else
173- dirURL = [baseDirUrl URLByAppendingPathComponent: kMSACAppCenterBundleIdentifier ];
173+ dirURL = [baseDirUrl URLByAppendingPathComponent: kMSACAppCenterBundleIdentifier isDirectory: YES ];
174174#endif
175175 [self createDirectoryAtURL: dirURL];
176176 });
0 commit comments