Skip to content

Commit

Permalink
... who knows? Oh- google does\! It's got diff tools\!
Browse files Browse the repository at this point in the history
  • Loading branch information
ccgus committed Nov 4, 2008
1 parent 658b630 commit 8076e4e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
1 change: 0 additions & 1 deletion davtest/FMWebDAVRequest.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ enum {
@property (assign) NSInteger responseStatusCode;
@property (retain) NSError *error;


+ (id) requestToURL:(NSURL*)url;
+ (id) requestToURL:(NSURL*)url delegate:(id)del endSelector:(SEL)anEndSelector contextInfo:(id)context;

Expand Down
26 changes: 23 additions & 3 deletions davtest/FMWebDAVRequest.m
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ - (FMWebDAVRequest*) createDirectory {
_endSelector = @selector(requestDidCreateDirectory:);
}

NSMutableURLRequest *req = [NSMutableURLRequest requestWithURL:_url];
NSMutableURLRequest *req = [NSMutableURLRequest requestWithURL:_url];

[req setCachePolicy:NSURLRequestReloadIgnoringLocalAndRemoteCacheData];

[req setHTTPMethod:@"MKCOL"];

Expand All @@ -101,7 +103,9 @@ - (FMWebDAVRequest*) delete {
_endSelector = @selector(requestDidDelete:);
}

NSMutableURLRequest *req = [NSMutableURLRequest requestWithURL:_url];
NSMutableURLRequest *req = [NSMutableURLRequest requestWithURL:_url];

[req setCachePolicy:NSURLRequestReloadIgnoringLocalAndRemoteCacheData];

[req setHTTPMethod:@"DELETE"];

Expand All @@ -120,9 +124,15 @@ - (FMWebDAVRequest*) putData:(NSData*)data {

NSMutableURLRequest *req = [NSMutableURLRequest requestWithURL:_url];

[req setCachePolicy:NSURLRequestReloadIgnoringLocalAndRemoteCacheData];

[req setHTTPMethod:@"PUT"];

[req setValue:@"application/octet-stream" forHTTPHeaderField:@"Content-Type"];
[req setValue:@"FMKit" forHTTPHeaderField:@"User-Agent"];

// this actually speeds things up for some reason.
[req setValue:[NSString stringWithFormat:@"%d", [data length]] forHTTPHeaderField:@"Content-Length"];

[req setHTTPBody:data];

Expand All @@ -139,6 +149,8 @@ - (FMWebDAVRequest*) get {

NSMutableURLRequest *req = [NSMutableURLRequest requestWithURL:_url];

[req setCachePolicy:NSURLRequestReloadIgnoringLocalAndRemoteCacheData];

[self sendRequest:req];

return self;
Expand All @@ -152,6 +164,8 @@ - (FMWebDAVRequest*) copyToDestinationURL:(NSURL*)dest {

NSMutableURLRequest *req = [NSMutableURLRequest requestWithURL:_url];

[req setCachePolicy:NSURLRequestReloadIgnoringLocalAndRemoteCacheData];

[req setHTTPMethod:@"COPY"];

[req setValue:[dest absoluteString] forHTTPHeaderField:@"Destination"];
Expand All @@ -169,6 +183,8 @@ - (FMWebDAVRequest*) moveToDestinationURL:(NSURL*)dest {

NSMutableURLRequest *req = [NSMutableURLRequest requestWithURL:_url];

[req setCachePolicy:NSURLRequestReloadIgnoringLocalAndRemoteCacheData];

[req setHTTPMethod:@"MOVE"];

[req setValue:[dest absoluteString] forHTTPHeaderField:@"Destination"];
Expand All @@ -186,6 +202,8 @@ - (FMWebDAVRequest*) head {

NSMutableURLRequest *req = [NSMutableURLRequest requestWithURL:_url];

[req setCachePolicy:NSURLRequestReloadIgnoringLocalAndRemoteCacheData];

[req setHTTPMethod:@"HEAD"];

[self sendRequest:req];
Expand Down Expand Up @@ -213,7 +231,9 @@ - (FMWebDAVRequest*) fetchDirectoryListingWithDepth:(NSUInteger)depth {
_endSelector = @selector(requestDidFetchDirectoryListing:);
}

NSMutableURLRequest *req = [NSMutableURLRequest requestWithURL:_url];
NSMutableURLRequest *req = [NSMutableURLRequest requestWithURL:_url];

[req setCachePolicy:NSURLRequestReloadIgnoringLocalAndRemoteCacheData];

// the trailing / always gets stripped off for some reason...
_uriLength = [[_url path] length] + 1;
Expand Down

0 comments on commit 8076e4e

Please sign in to comment.