ADC Home > Reference Library > Documentation > Performance > Xgrid Foundation Reference

Methods


-fileDownload:decideDestinationWithSuggestedPath:
This method is called when enough information has been loaded to decide a destination for the downloaded file.
-fileDownload:didCreateDestination:
This method is called if the download creates a downloaded file.
-fileDownload:didFailWithError:
This method is called when the download has failed.
-fileDownload:didReceiveAttributes:
This method is called when the download has loaded the attributes of the file.
-fileDownload:didReceiveData:
This method is called when the download has loaded data.
-fileDownloadDidBegin:
This method is called immediately after the download has started.
-fileDownloadDidFinish:
This method is called when the download has finished downloading.

fileDownload:decideDestinationWithSuggestedPath:


This method is called when enough information has been loaded to decide a destination for the downloaded file.

- (void)fileDownload:(XGFileDownload *)fileDownload 
        decideDestinationWithSuggestedPath:(NSString *)path;
Parameter Descriptions
fileDownload
The download that requests the download path.
filename
The suggested relative path for deciding the path of the downloaded file.
Discussion

Once the delegate has decided a path, it should call setDestination:allowOverwrite:. This delegate method will not be called if setDestination:allowOverwrite: has already been called. If the destination is not set, or if the destination is set to nil, no file will be saved to disk.


fileDownload:didCreateDestination:


This method is called if the download creates a downloaded file.

- (void)fileDownload:(XGFileDownload *)fileDownload 
        didCreateDestination:(NSString *)destination;
Parameter Descriptions
fileDownload
The download that created the downloaded file.
path
The path of the downloaded file.

fileDownload:didFailWithError:


This method is called when the download has failed.

- (void)fileDownload:(XGFileDownload *)fileDownload 
        didFailWithError:(NSError *)error;
Parameter Descriptions
fileDownload
The download that ended in error.
error
The error caused the download to fail.
Discussion

This method is called when the download encounters a network or file I/O related error. This method or downloadDidFinish: will only be called once.


fileDownload:didReceiveAttributes:


This method is called when the download has loaded the attributes of the file.

- (void)fileDownload:(XGFileDownload *)fileDownload 
        didReceiveAttributes:(NSDictionary *)attributes;
Parameter Descriptions
fileDownload
The download that has received the attributes.
data
The received attributes.
Discussion

This method will be called once.


fileDownload:didReceiveData:


This method is called when the download has loaded data.

- (void)fileDownload:(XGFileDownload *)fileDownload 
        didReceiveData:(NSData *)data;
Parameter Descriptions
fileDownload
The download that has received data.
data
The received data.
Discussion

This method will be called one or more times. If the download is also being written to disk then this method will be called immediately after the data is written to disk.


fileDownloadDidBegin:


This method is called immediately after the download has started.

- (void)fileDownloadDidBegin:(XGFileDownload *)fileDownload;
Parameter Descriptions
fileDownload
The download that just started downloading.

fileDownloadDidFinish:


This method is called when the download has finished downloading.

- (void)fileDownloadDidFinish:(XGFileDownload *)fileDownload;
Parameter Descriptions
fileDownload
The download that has finished downloading.
Discussion

This method is called after all the data has been received and written to disk. This method or download:didFailWithError: will only be called once.

(Last Updated April 21, 2005)