
#import <Foundation/Foundation.h>

@class XGFileDownloadInternal;
@class XGFile;

@interface XGFileDownload : NSObject

/*file


Returns the file of the download. 
- (XGFile *)file;
method result
The file of the download.*/
- (XGFile *)file;

/*initWithFile:delegate:


Initializes a XGFileDownload object and starts the download. 
- (id)initWithFile:(XGFile *)file delegate:(id)delegate;
Parameter Descriptions
file
The file to download. Must not be nil.
delegate
The delegate of the download.
method result
An initialized XGFileDownload object.*/
- (id)initWithFile:(XGFile *)file delegate:(id)delegate;

/*setDestination:allowOverwrite:


Sets the destination path of the downloaded file. 
- (void)setDestination:(NSString *)destination 
        allowOverwrite:(BOOL)allowOverwrite;
Parameter Descriptions
path
The destination path of the downloaded file.
allowOverwrite
Allows a file of the same path to be overwritten.
Discussion

This method can be called after the download is created or in response to the decideDestinationWithSuggestedFilename: delegate method. It should only be called once. If NO is passed for allowOverwrite and a file of the same path exists, a number will be appended to the filename to prevent the overwrite. Because of this, use the path passed with didCreateDestination: to determine the actual path of the downloaded file.*/
- (void)setDestination:(NSString *)destination 
        allowOverwrite:(BOOL)allowOverwrite;

@end

//@interface NSObject (XGFileDownloadDelegate)
//@end
