MDLFile Class Reference
Inherits from | NSObject |
Declared in | MDLFile.h MDLFile.m |
Tasks
-
dateAdded
The file added date.
property -
extension
The file extension.
property -
hash
The file hash.
property -
size
The file size.
property -
publicURL
The file public URL.
property -
document
The file document.
property -
+ fileWithDateAdded:extension:hash:size:document:
Creates a
MDLFile
and initializes its date added, extension, hash, and size properties. -
+ fileWithPublicURL:document:
Creates a
MDLFile
and initializes its public URL property. -
– downloadToFileAtPath:progress:success:failure:
Sends a download file API request using the shared client.
Properties
dateAdded
The file added date.
@property (strong, nonatomic) NSDate *dateAdded
Discussion
The file added date.
Declared In
MDLFile.h
document
The file document.
@property (weak, nonatomic) MDLDocument *document
Discussion
The file document.
Declared In
MDLFile.h
extension
The file extension.
@property (copy, nonatomic) NSString *extension
Discussion
The file extension.
Declared In
MDLFile.h
hash
The file hash.
@property (copy, nonatomic) NSString *hash
Discussion
The file hash.
Declared In
MDLFile.h
Class Methods
fileWithDateAdded:extension:hash:size:document:
+ (MDLFile *)fileWithDateAdded:(NSDate *)dateAdded extension:(NSString *)extension hash:(NSString *)hash size:(NSNumber *)size document:(MDLDocument *)document
Parameters
- dateAdded
The date added of the file.
- extension
The extension of the file.
- hash
The hash of the file.
- size
The size of the file.
- document
The document of the file.
Return Value
The newly-initialized file.
Declared In
MDLFile.h
fileWithPublicURL:document:
Creates a MDLFile
and initializes its public URL property.
+ (MDLFile *)fileWithPublicURL:(NSURL *)publicURL document:(MDLDocument *)document
Return Value
The newly-initialized file.
Discussion
Creates a MDLFile
and initializes its public URL property.
Declared In
MDLFile.h
Instance Methods
downloadToFileAtPath:progress:success:failure:
Sends a download file API request using the shared client.
- (AFHTTPRequestOperation *)downloadToFileAtPath:(NSString *)path progress:(void ( ^ ) ( NSUInteger bytesRead , long long totalBytesRead , long long totalBytesExpectedToRead ))progress success:(void ( ^ ) ( ))success failure:(void ( ^ ) ( NSError *))failure
Parameters
- path
The path to the file to download to.
- progress
A block object to be called when an undetermined number of bytes have been downloaded from the server. This block has no return value and takes three arguments: the number of bytes read since the last time the download progress block was called, the total bytes read, and the total bytes expected to be read during the request, as initially determined by the expected content size of the
NSHTTPURLResponse
object. This block may be called multiple times, and will execute on the main thread.
- success
A block object to be executed when the request operation finishes successfully. This block has no return value and takes no argument.
- failure
A block object to be executed when the request operation finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the resonse data. This block has no return value and takes one argument: the
NSError
object describing the network or parsing error that occurred.
Return Value
A new HTTP request operation
Discussion
Sends a download file API request using the shared client.
See Also
Declared In
MDLFile.h