forked from eklipse2k8/CocoaRestClient
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCRCFileRequest.m
More file actions
27 lines (22 loc) · 746 Bytes
/
Copy pathCRCFileRequest.m
File metadata and controls
27 lines (22 loc) · 746 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
//
// CRCFileRequest.m
// CocoaRestClient
//
// Created by Adam Venturella on 7/10/10.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
#import "CRCFileRequest.h"
#import "CocoaRestClientAppDelegate.h"
@implementation CRCFileRequest
+(void)createRequest:(NSMutableURLRequest *)request
{
CocoaRestClientAppDelegate * delegate = (CocoaRestClientAppDelegate *)[[NSApplication sharedApplication] delegate];
NSMutableData * body = [NSMutableData data];
NSURL * path = [[delegate.filesTable objectAtIndex:0] objectForKey:@"url"];
if([[NSFileManager defaultManager] fileExistsAtPath:[path relativePath]])
{
[body appendData:[NSData dataWithContentsOfFile:[path relativePath]]];
[request setHTTPBody: body];
}
}
@end