+ (id)aliasWithContentsOfFile:(NSString *)aPath;
The method aliasWithContentsOfFile: allocates and initalises an NDAlias with the alias record data within the Finder alias file pointed to by the NSString path aPath.
Result: A NDAlias instance, returns nil if NDAlias creation fails.
Name Description aPath the path to an alias file.
+ (id)aliasWithContentsOfURL:(NSURL *)aURL;
The method aliasWithContentsOfURL: allocates and initalises an NDAlias with the alias record data within the Finder NSURL alias file pointed to pay the file url aURL
Result: A NDAlias instance, returns nil if NDAlias creation fails.
Name Description aURL the file url to the alias file.
+ (id)aliasWithData:(NSData *)aData;
The method aliasWithData: creates a NDAlias that describes the specified target. aliasWithData: creates the NDAlias from the data that was returned from the method data
Result: A NDAlias instance, returns nil if NDAlias creation fails.
Name Description aData The NSData instaqnces that contains the data returned previously from the method data.
+ (id)aliasWithPath:(NSString *)aPath;
The method aliasWithPath: creates an NDAlias that contains only the minimum information necessary to describe the target: the target name, the parent directory ID, the volume name and creation date, and the volume mounting information. The aliasWithPath: method uses the standard alias record data structure, but it fills in only parts of the record.
The methods url and path never update a minimal alias record.
Result: A NDAlias instance, returns nil if NDAlias creation fails.
Name Description aPath the path for the target of the alias.
+ (id)aliasWithPath:(NSString *)aPath fromPath:(NSString *)aFromPath;
The method aliasWithPath:fromPath: creates a NDAlias that describes the specified target. aliasWithPath:fromPath: always records the name and file or directory ID of the target, its creation date, the parent directory name and ID, and the volume name and creation date. It also records the full pathname of the target and a collection of other information relevant to locating the target, verifying the target, and mounting the target's volume, if necessary. aliasWithPath:fromPath: also stores relative path information as well by supplying a starting point for a relative path.
Result: A NDAlias instance, returns nil if NDAlias creation fails.
Name Description aURL the file url for the target of the alias. aFromPath The starting point for a relative path, to be used later in a relative search. The two file or directory url's, aFromPath and aURL, must reside on the same volume.
+ (id)aliasWithURL:(NSURL *)aURL;
The method aliasWithURL: creates an NDAlias that contains only the minimum information necessary to describe the target: the target name, the parent directory ID, the volume name and creation date, and the volume mounting information. The aliasWithURL: method uses the standard alias record data structure, but it fills in only parts of the record.
The methods url and path never update a minimal alias record.
Result: A NDAlias instance, returns nil if NDAlias creation fails.
Name Description aURL the file url for the target of the alias.
+ (id)aliasWithURL:(NSURL *)aURL fromURL:(NSURL *)aFromURL;
The method aliasWithURL:fromURL: creates a NDAlias that describes the specified target. aliasWithURL:fromURL: always records the name and file or directory ID of the target, its creation date, the parent directory name and ID, and the volume name and creation date. It also records the full pathname of the target and a collection of other information relevant to locating the target, verifying the target, and mounting the target's volume, if necessary. aliasWithURL:fromURL: also stores relative path information as well by supplying a starting point for a relative path.
Result: A NDAlias instance, returns nil if NDAlias creation fails.
Name Description aURL the file url for the target of the alias. aFromURL The starting point for a relative path, to be used later in a relative search. The two file or directory url's, aFromURL and aURL, must reside on the same volume.
- (BOOL)changed;
The method changed indicates whether the receiver was updated because it contained some outdated information about the target. If it the receiver is updated, YES is returned. Otherwise, it return NO. (url and path never update a NDAlias that was created with no relative path.)
Result: YES if the receiver was updated, NO if it was not updated.- (NSData *)data;
The method data returns the contents of the recievers as an NSData, this can be used for archiving perposes though NDAlias does implement the NSCoding protocol.
Result: Returns an NSData instance.- (id)initWithContentsOfFile:(NSString *)aPath;
The method initWithContentsOfFile: initalises the receiver with the alias record data within the Finder alias file pointed to by the NSString path aPath
Result: An initalises NDAlias, returns nil if initalises fails.
Name Description aPath the path to the alias file.
- (id)initWithContentsOfURL:(NSURL *)aURL;
The method initWithContentsOfURL: initalises the reciever with the alias record data within the Finder NSURL alias file pointed to pay the file url aURL.
Result: An initalises NDAlias, returns nil if initalises fails.
Name Description aURL the file url to the alias file.
- (id)initWithData:(NSData *)aData;
The method initWithData: initalises a NDAlias that describes the specified target. initWithData: creates the NDAlias from the data that was returned from the method data
Result: An initalises NDAlias, returns nil if initalises fails.
Name Description aData The NSData instaqnces that contains the data returned previously from the method data.
- (id)initWithPath:(NSString *)aPath;
The method initWithPath: initalises an NDAlias that contains only the minimum information necessary to describe the target: the target name, the parent directory ID, the volume name and creation date, and the volume mounting information. The initWithPath: method uses the standard alias record data structure, but it fills in only parts of the record.
The methods url and path never update a minimal alias record.
Result: An initalises NDAlias, returns nil if initalises fails.
Name Description aPath the path for the target of the alias.
- (id)initWithPath:(NSString *)aPath fromPath:(NSString *)aFromPath;
The method initWithPath:fromPath: initalises a NDAlias that describes the specified target. initWithPath:fromPath: always records the name and file or directory ID of the target, its creation date, the parent directory name and ID, and the volume name and creation date. It also records the full pathname of the target and a collection of other information relevant to locating the target, verifying the target, and mounting the target's volume, if necessary. initWithPath:fromPath: also stores relative path information as well by supplying a starting point for a relative path.
Result: An initalises NDAlias, returns nil if initalises fails.
Name Description aPath the file url for the target of the alias. aFromPath The starting point for a relative path, to be used later in a relative search. The two file or directory url's, aFromPath and aPath, must reside on the same volume.
- (id)initWithURL:(NSURL *)aURL fromURL:(NSURL *)aFromURL;
The method initWithPath:fromURL: initalises a NDAlias that describes the specified target. initWithPath:fromURL: always records the name and file or directory ID of the target, its creation date, the parent directory name and ID, and the volume name and creation date. It also records the full pathname of the target and a collection of other information relevant to locating the target, verifying the target, and mounting the target's volume, if necessary. initWithPath:fromURL: also stores relative path information as well by supplying a starting point for a relative path.
Result: An initalises NDAlias, returns nil if initalises fails.
Name Description aURL the file url for the target of the alias. aFromURL The starting point for a relative path, to be used later in a relative search. The two file or directory url's, aFromURL and aURL, must reside on the same volume.
- (id)initWithURL:(NSURL *)aURL;
The method initWithURL: initalises an NDAlias that contains only the minimum information necessary to describe the target: the target name, the parent directory ID, the volume name and creation date, and the volume mounting information. The initWithURL: method uses the standard alias record data structure, but it fills in only parts of the record.
The methods url and path never update a minimal alias record.
Result: A NDAlias instance, returns nil if NDAlias creation fails.
Name Description aURL the file url for the target of the alias.
- (NSString *)path;
The method path performs a fast search for the target of the receiver. If the resolution is successful, path returns a path NSString for the target file system object, updates the receiver if necessary, and reports (through the method changed) whether the receiver was updated. If the target is on an unmounted AppleShare volume, path automatically mounts the volume. If the target is on an unmounted ejectable volume, path asks the user to insert the volume.
After it identifies a target, path compares some key information about the target with the information in the receiver. If the information differs, path updates the receiver to match the target.
The path method displays the standard dialog boxes when it needs input from the user, such as a name and password for mounting a remote volume. The user can cancel the resolution through these dialog boxes.
Result: A path NSString to the target of the receiver. nil is returned if no target could be found.- (BOOL)setPath:(NSString *)aPath;
The method setPath: rebuilds the entire recievers alias record .
Result: Returns YES if setting the target succeeded, otherwise returns NO.
Name Description aPath the path for the target of the reciever.
- (BOOL)setURL:(NSURL *)aURL;
The method setURL: rebuilds the entire recievers alias record .
Result: Returns YES if setting the target succeeded, otherwise returns NO.
Name Description aURL the file url for the target of the alias.
- (BOOL)setPath:(NSString *)aPath fromPath:(NSString *)aFromPath;
The method setURL:fromURL: rebuilds the entire recievers alias record .
The setURL:fromURL: function always creates a complete alias record. When you use setURL:fromURL: to update a minimal alias record, you convert the minimal record to a complete record.
Result: Returns YES if setting the target succeeded, otherwise returns NO.
Name Description aPath the path for the target of the reciever. aFromPath The starting point for a relative path, to be used later in a relative search. The two file or directory paths, aFromPath and aPath, must reside on the same volume.
- (BOOL)setURL:(NSURL *)aURL fromURL:(NSURL *)aFromURL;
The method setURL:fromURL: rebuilds the entire recievers alias record .
The setURL:fromURL: function always creates a complete alias record. When you use setURL:fromURL: to update a minimal alias record, you convert the minimal record to a complete record.
Result: Returns YES if setting the target succeeded, otherwise returns NO.
Name Description aURL the file url for the target of the reciever. aFromURL The starting point for a relative path, to be used later in a relative search. The two file or directory url's, aFromURL and aURL, must reside on the same volume.
- (NSURL *)url;
The url method performs a fast search for the target of the receiver. If the resolution is successful, url returns a file NSURL for the target file system object, updates the receiver if necessary, and reports (through the method changed) whether the receiver was updated. If the target is on an unmounted AppleShare volume, url automatically mounts the volume. If the target is on an unmounted ejectable volume, url asks the user to insert the volume.
After it identifies a target, url compares some key information about the target with the information in the receiver. If the information differs, url updates the receiver to match the target.
The url method displays the standard dialog boxes when it needs input from the user, such as a name and password for mounting a remote volume. The user can cancel the resolution through these dialog boxes.
Result: A file NSURL to the target of the receiver. nil is returned if no target could be found.- (BOOL)writeToFile:(NSString *)aPath;
The method writeToFile: writes the alias record data contained within the reciever to a Finder alias file at the path aPath. writeToFile: can be used to create alias files that the user can see in Finder and use.
Result: «result»
Name Description aPath the path for the alias file. Not the path the alias record represents.
- (BOOL)writeToURL:(NSURL *)aURL;
The method writeToURL: writes the alias record data contained within the reciever to a Finder alias file at the file url aURL. writeToFile: can be used to create alias files that the user can see in Finder and use.
Result: «result»
Name Description aURL the file url for the alias file. Not the file url the alias record represents.
© 2003 Nathan Day (Last Updated 11/30/2003)