ProjectManager 0.2
FileManager(Private) Category Reference

Instance Methods

(BOOL) - validateAction:
 Validates an action.
 
(NSMutableDictionary *) - fileEntryAtPath:
 Returns the file entry which represents ‘aPath’ in the file management dictionary.
 
(NSMutableArray *) - categoryContentsArrayAtPath:
 Returns the contents array of the category at path ‘aPath’.
 
(BOOL) - copyPlainFileAtPath:toPath:error:
 Copies a plain file in the project.
 
(BOOL) - copyLinkAtPath:toPath:error:
 Copies a link in the project.
 
(BOOL) - copyCategoryAtPath:toPath:error:
 Copies a category recursively in the project.
 
(BOOL) - movePlainFileAtPath:toPath:error:
 Moves a plain file in the project.
 
(BOOL) - moveLinkAtPath:toPath:error:
 Moves a link in the project.
 
(BOOL) - moveCategoryAtPath:toPath:error:
 Moves a category recursively in the project.
 
(BOOL) - performFileClashCheckFromPath:toPath:error:
 Performs a check whether the file at path ‘aPath’ doesn't clash with an file if it were to exist at path ‘newPath’.
 
(void) - addEntryAtPath:ofType:withArgument:
 Adds an entry at ‘aPath’ with the file type set to ‘aFileType’.
 
(void) - removeEntryAtPath:
 Removes a file system dictionary entry.
 
(NSString *) - makeNewUniqueNameFromBasename:pathExtension:inCategory:andDirectory:
 Makes a new name from ‘basename’ so that it is unique in ‘category’ and ‘directory’.
 
(NSString *) - recursivelyLocateFileAtPhysicalPath:inCategory:
 This method recursively searches for a file based on it's physical on-disk location in a certain category and it's descendents.
 
(NSString *) - internalTypeOfFileAtPath:
 
(BOOL) - internalImportFile:renameTo:toPath:link:error:
 The actual implementation of the -[FileManager importFile:renameTo:toPath:link:error:] method.
 

Method Documentation

◆ addEntryAtPath:ofType:withArgument:

- (void) addEntryAtPath: (NSString *) aPath
ofType: (NSString *) aFileType
withArgument: (NSString *) anArgument 

Adds an entry at ‘aPath’ with the file type set to ‘aFileType’.

In case the created file is a link, ‘anArgument’ should contain the link's target.

◆ categoryContentsArrayAtPath:

- (NSMutableArray *) categoryContentsArrayAtPath: (NSString *) aPath

Returns the contents array of the category at path ‘aPath’.

Returns
the category's contents array if it is found, or ‘nil’ if it isn't.

◆ copyCategoryAtPath:toPath:error:

- (BOOL) copyCategoryAtPath: (NSString *) aPath
toPath: (NSString *) newPath
error: (NSError **) error 

Copies a category recursively in the project.

Parameters
aPathThe path from which to copy the category.
newPathThe path to which to copy the category.
errorA pointer to an NSError variable which will be filled with an error in description in case an error occurs during the operation.
Returns
YES if the operation succeeds, NO if it doesn't.

◆ copyLinkAtPath:toPath:error:

- (BOOL) copyLinkAtPath: (NSString *) aPath
toPath: (NSString *) newPath
error: (NSError **) error 

Copies a link in the project.

Parameters
aPathThe path from which to copy the link.
newPathThe path to which to copy the link.
errorA pointer to an NSError variable which will be filled with an error in description in case an error occurs during the operation.
Returns
YES if the operation succeeds, NO if it doesn't.

◆ copyPlainFileAtPath:toPath:error:

- (BOOL) copyPlainFileAtPath: (NSString *) aPath
toPath: (NSString *) newPath
error: (NSError **) error 

Copies a plain file in the project.

Parameters
aPathThe path from which to copy the file.
newPathThe path to which to copy the file.
errorA pointer to an NSError variable which will be filled with an error in description in case an error occurs during the operation.
Returns
YES if the operation succeeds, NO if it doesn't.

◆ fileEntryAtPath:

- (NSMutableDictionary *) fileEntryAtPath: (NSString *) aPath

Returns the file entry which represents ‘aPath’ in the file management dictionary.

Returns
the entry if it is found, or ‘nil’ if it isn't.

◆ makeNewUniqueNameFromBasename:pathExtension:inCategory:andDirectory:

- (NSString *) makeNewUniqueNameFromBasename: (NSString *) basename
pathExtension: (NSString *) ext
inCategory: (NSString *) category
andDirectory: (NSString *) directory 

Makes a new name from ‘basename’ so that it is unique in ‘category’ and ‘directory’.

E.g. basename = "New File", then the method will check whether @"New File" @"New File 1" @"New File 2" ... is unique in the provided category and directory. The first of these names which already is unique will be returned.

◆ moveCategoryAtPath:toPath:error:

- (BOOL) moveCategoryAtPath: (NSString *) aPath
toPath: (NSString *) newPath
error: (NSError **) error 

Moves a category recursively in the project.

Parameters
aPathThe path from which to move the category.
newPathThe path to which to move the category.
errorA pointer to an NSError variable which will be filled with an error in description in case an error occurs during the operation.
Returns
YES if the operation succeeds, NO if it doesn't.

◆ moveLinkAtPath:toPath:error:

- (BOOL) moveLinkAtPath: (NSString *) aPath
toPath: (NSString *) newPath
error: (NSError **) error 

Moves a link in the project.

The link's target will be recomputed in order to keep the link valid.

Parameters
aPathThe path from which to move the link.
newPathThe path to which to move the link.
errorA pointer to an NSError variable which will be filled with an error in description in case an error occurs during the operation.
Returns
YES if the operation succeeds, NO if it doesn't.

◆ movePlainFileAtPath:toPath:error:

- (BOOL) movePlainFileAtPath: (NSString *) aPath
toPath: (NSString *) newPath
error: (NSError **) error 

Moves a plain file in the project.

Parameters
aPathThe path from which to move the file.
newPathThe path to which to move the file.
errorA pointer to an NSError variable which will be filled with an error in description in case an error occurs during the operation.
Returns
YES if the operation succeeds, NO if it doesn't.

◆ performFileClashCheckFromPath:toPath:error:

- (BOOL) performFileClashCheckFromPath: (NSString *) aPath
toPath: (NSString *) newPath
error: (NSError **) error 

Performs a check whether the file at path ‘aPath’ doesn't clash with an file if it were to exist at path ‘newPath’.

For the various file types this means:

  • virtual files: check whether the file doesn't already exist in the destination category
  • plain files and links: same as for virtual files, and additionally check that there's no underlying disk file in the way
  • categories: same as for virtual files, and additionally perform this method for all it's descendents recursively
Returns
YES if there is no clash, NO if there is one.

◆ recursivelyLocateFileAtPhysicalPath:inCategory:

- (NSString *) recursivelyLocateFileAtPhysicalPath: (NSString *) diskLocation
inCategory: (NSString *) aCategory 

This method recursively searches for a file based on it's physical on-disk location in a certain category and it's descendents.

Parameters
diskLocationThe physical location of the file.
aCategoryThe category in which to recursively look for the file.
Returns
An in-project path to a file who's physical location is that indicated by the first argument. If no such file exists in the project, ‘nil’ is returned instead.

◆ removeEntryAtPath:

- (void) removeEntryAtPath: (NSString *) aPath

Removes a file system dictionary entry.

Parameters
aPathA path to the file who's entry to remove.

◆ validateAction:

- (BOOL) validateAction: (SEL) action

Validates an action.

This is used to unify validation of toolbar items and menu items into a single routine.

Parameters
actionThe action which to validate.
Returns
YES if the action is valid, NO if it isn't.

The documentation for this category was generated from the following file: