|
@@ -151,18 +151,18 @@ NSString const *OCWebDAVModificationDateKey = @"modificationdate";
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
-- (NSMutableURLRequest *)requestWithMethod:(NSString *)method path:(NSString *)path parameters:(NSDictionary *)parameters {
|
|
|
|
|
|
+- (NSMutableURLRequest *)requestWithMethod:(NSString *)method path:(NSString *)path parameters:(NSDictionary *)parameters timeout:(NSTimeInterval)timeout {
|
|
|
|
|
|
NSMutableURLRequest *request = [[AFHTTPRequestSerializer new] requestWithMethod:method URLString:path parameters:nil error:nil];
|
|
NSMutableURLRequest *request = [[AFHTTPRequestSerializer new] requestWithMethod:method URLString:path parameters:nil error:nil];
|
|
[request setAllHTTPHeaderFields:self.defaultHeaders];
|
|
[request setAllHTTPHeaderFields:self.defaultHeaders];
|
|
|
|
|
|
[request setCachePolicy: NSURLRequestReloadIgnoringLocalCacheData];
|
|
[request setCachePolicy: NSURLRequestReloadIgnoringLocalCacheData];
|
|
- [request setTimeoutInterval: k_timeout_webdav];
|
|
|
|
|
|
+ [request setTimeoutInterval: timeout];
|
|
|
|
|
|
return request;
|
|
return request;
|
|
}
|
|
}
|
|
|
|
|
|
-- (NSMutableURLRequest *)sharedRequestWithMethod:(NSString *)method path:(NSString *)path parameters:(NSDictionary *)parameters {
|
|
|
|
|
|
+- (NSMutableURLRequest *)sharedRequestWithMethod:(NSString *)method path:(NSString *)path parameters:(NSDictionary *)parameters timeout:(NSTimeInterval)timeout {
|
|
|
|
|
|
NSMutableURLRequest *request = [[AFHTTPRequestSerializer new] requestWithMethod:method URLString:path parameters:nil error:nil];
|
|
NSMutableURLRequest *request = [[AFHTTPRequestSerializer new] requestWithMethod:method URLString:path parameters:nil error:nil];
|
|
|
|
|
|
@@ -186,7 +186,7 @@ NSString const *OCWebDAVModificationDateKey = @"modificationdate";
|
|
success:(void(^)(NSHTTPURLResponse *, id))success
|
|
success:(void(^)(NSHTTPURLResponse *, id))success
|
|
failure:(void(^)(NSHTTPURLResponse *, id _Nullable responseObject, NSError *))failure {
|
|
failure:(void(^)(NSHTTPURLResponse *, id _Nullable responseObject, NSError *))failure {
|
|
_requestMethod = @"MOVE";
|
|
_requestMethod = @"MOVE";
|
|
- NSMutableURLRequest *request = [self requestWithMethod:_requestMethod path:source parameters:nil];
|
|
|
|
|
|
+ NSMutableURLRequest *request = [self requestWithMethod:_requestMethod path:source parameters:nil timeout:k_timeout_webdav];
|
|
[request setValue:destination forHTTPHeaderField:@"Destination"];
|
|
[request setValue:destination forHTTPHeaderField:@"Destination"];
|
|
[request setValue:@"T" forHTTPHeaderField:@"Overwrite"];
|
|
[request setValue:@"T" forHTTPHeaderField:@"Overwrite"];
|
|
OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
|
|
OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
|
|
@@ -200,7 +200,7 @@ NSString const *OCWebDAVModificationDateKey = @"modificationdate";
|
|
failure:(void(^)(NSHTTPURLResponse *, id _Nullable responseObject, NSError *))failure {
|
|
failure:(void(^)(NSHTTPURLResponse *, id _Nullable responseObject, NSError *))failure {
|
|
|
|
|
|
_requestMethod = @"DELETE";
|
|
_requestMethod = @"DELETE";
|
|
- NSMutableURLRequest *request = [self requestWithMethod:_requestMethod path:path parameters:nil];
|
|
|
|
|
|
+ NSMutableURLRequest *request = [self requestWithMethod:_requestMethod path:path parameters:nil timeout:k_timeout_webdav];
|
|
OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
|
|
OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
|
|
[self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.networkSessionManager];
|
|
[self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.networkSessionManager];
|
|
[operation resume];
|
|
[operation resume];
|
|
@@ -214,7 +214,7 @@ NSString const *OCWebDAVModificationDateKey = @"modificationdate";
|
|
NSParameterAssert(success);
|
|
NSParameterAssert(success);
|
|
|
|
|
|
_requestMethod = @"PROPFIND";
|
|
_requestMethod = @"PROPFIND";
|
|
- NSMutableURLRequest *request = [self requestWithMethod:_requestMethod path:path parameters:nil];
|
|
|
|
|
|
+ NSMutableURLRequest *request = [self requestWithMethod:_requestMethod path:path parameters:nil timeout:k_timeout_webdav];
|
|
|
|
|
|
[request setValue: depth forHTTPHeaderField: @"Depth"];
|
|
[request setValue: depth forHTTPHeaderField: @"Depth"];
|
|
[request setHTTPBody:[@"<?xml version=\"1.0\" encoding=\"UTF-8\"?><D:propfind xmlns:D=\"DAV:\" xmlns:oc=\"http://owncloud.org/ns\" xmlns:nc=\"http://nextcloud.org/ns\"><D:prop><D:resourcetype/><D:getlastmodified/><size xmlns=\"http://owncloud.org/ns\"/><favorite xmlns=\"http://owncloud.org/ns\"/><id xmlns=\"http://owncloud.org/ns\"/><D:getcontentlength/><D:getetag/><permissions xmlns=\"http://owncloud.org/ns\"/><D:getcontenttype/><nc:is-encrypted/></D:prop></D:propfind>" dataUsingEncoding:NSUTF8StringEncoding]];
|
|
[request setHTTPBody:[@"<?xml version=\"1.0\" encoding=\"UTF-8\"?><D:propfind xmlns:D=\"DAV:\" xmlns:oc=\"http://owncloud.org/ns\" xmlns:nc=\"http://nextcloud.org/ns\"><D:prop><D:resourcetype/><D:getlastmodified/><size xmlns=\"http://owncloud.org/ns\"/><favorite xmlns=\"http://owncloud.org/ns\"/><id xmlns=\"http://owncloud.org/ns\"/><D:getcontentlength/><D:getetag/><permissions xmlns=\"http://owncloud.org/ns\"/><D:getcontenttype/><nc:is-encrypted/></D:prop></D:propfind>" dataUsingEncoding:NSUTF8StringEncoding]];
|
|
@@ -233,7 +233,7 @@ NSString const *OCWebDAVModificationDateKey = @"modificationdate";
|
|
NSParameterAssert(success);
|
|
NSParameterAssert(success);
|
|
|
|
|
|
_requestMethod = @"PROPFIND";
|
|
_requestMethod = @"PROPFIND";
|
|
- NSMutableURLRequest *request = [self requestWithMethod:_requestMethod path:path parameters:nil];
|
|
|
|
|
|
+ NSMutableURLRequest *request = [self requestWithMethod:_requestMethod path:path parameters:nil timeout:k_timeout_webdav];
|
|
|
|
|
|
[request setValue: depth forHTTPHeaderField: @"Depth"];
|
|
[request setValue: depth forHTTPHeaderField: @"Depth"];
|
|
[request setHTTPBody:[@"<?xml version=\"1.0\" encoding=\"UTF-8\"?><D:propfind xmlns:D=\"DAV:\" xmlns:oc=\"http://owncloud.org/ns\" xmlns:nc=\"http://nextcloud.org/ns\"><D:prop><D:resourcetype/><D:getlastmodified/><size xmlns=\"http://owncloud.org/ns\"/><favorite xmlns=\"http://owncloud.org/ns\"/><id xmlns=\"http://owncloud.org/ns\"/><D:getcontentlength/><D:getetag/><permissions xmlns=\"http://owncloud.org/ns\"/><D:getcontenttype/><nc:is-encrypted/></D:prop></D:propfind>" dataUsingEncoding:NSUTF8StringEncoding]];
|
|
[request setHTTPBody:[@"<?xml version=\"1.0\" encoding=\"UTF-8\"?><D:propfind xmlns:D=\"DAV:\" xmlns:oc=\"http://owncloud.org/ns\" xmlns:nc=\"http://nextcloud.org/ns\"><D:prop><D:resourcetype/><D:getlastmodified/><size xmlns=\"http://owncloud.org/ns\"/><favorite xmlns=\"http://owncloud.org/ns\"/><id xmlns=\"http://owncloud.org/ns\"/><D:getcontentlength/><D:getetag/><permissions xmlns=\"http://owncloud.org/ns\"/><D:getcontenttype/><nc:is-encrypted/></D:prop></D:propfind>" dataUsingEncoding:NSUTF8StringEncoding]];
|
|
@@ -266,51 +266,88 @@ NSString const *OCWebDAVModificationDateKey = @"modificationdate";
|
|
[self mr_listPath:path depth:depth withUserSessionToken:token onCommunication:sharedOCCommunication success:success failure:failure];
|
|
[self mr_listPath:path depth:depth withUserSessionToken:token onCommunication:sharedOCCommunication success:success failure:failure];
|
|
}
|
|
}
|
|
|
|
|
|
-- (void)search:(NSString *)path folder:(NSString *)folder fileName:(NSString *)fileName depth:(NSString *)depth dateLastModified:(NSString *)dateLastModified contentType:(NSString *)contentType user:(NSString *)user userID:(NSString *)userID onCommunication:(OCCommunication *)sharedOCCommunication withUserSessionToken:(NSString *)token success:(void(^)(NSHTTPURLResponse *, id, NSString *token))success failure:(void(^)(NSHTTPURLResponse *, id _Nullable responseObject, NSError *, NSString *token))failure {
|
|
|
|
|
|
+- (void)search:(NSString *)path folder:(NSString *)folder fileName:(NSString *)fileName depth:(NSString *)depth dateLastModified:(NSString *)dateLastModified contentType:(NSArray *)contentType user:(NSString *)user userID:(NSString *)userID onCommunication:(OCCommunication *)sharedOCCommunication withUserSessionToken:(NSString *)token success:(void(^)(NSHTTPURLResponse *, id, NSString *token))success failure:(void(^)(NSHTTPURLResponse *, id _Nullable responseObject, NSError *, NSString *token))failure {
|
|
|
|
|
|
- NSString *body;
|
|
|
|
|
|
+ NSString *body = @"";
|
|
|
|
+ NSString *whereType = @"";
|
|
|
|
|
|
NSParameterAssert(success);
|
|
NSParameterAssert(success);
|
|
|
|
|
|
_requestMethod = @"SEARCH";
|
|
_requestMethod = @"SEARCH";
|
|
|
|
|
|
- NSMutableURLRequest *request = [self requestWithMethod:_requestMethod path:path parameters:nil];
|
|
|
|
|
|
+ NSMutableURLRequest *request = [self requestWithMethod:_requestMethod path:path parameters:nil timeout:k_timeout_search];
|
|
|
|
|
|
- body = [NSString stringWithFormat: @""
|
|
|
|
- "<?xml version=\"1.0\"?>"
|
|
|
|
- "<d:searchrequest xmlns:d=\"DAV:\" xmlns:oc=\"http://owncloud.org/ns\" xmlns:nc=\"http://nextcloud.org/ns\">"
|
|
|
|
- "<d:basicsearch>"
|
|
|
|
- "<d:select>"
|
|
|
|
- "<d:prop>"
|
|
|
|
- "<d:getlastmodified />"
|
|
|
|
- "<d:getetag />"
|
|
|
|
- "<d:getcontenttype />"
|
|
|
|
- "<d:resourcetype/>"
|
|
|
|
- "<d:getcontentlength />"
|
|
|
|
- "<oc:fileid/>"
|
|
|
|
- "<oc:id/>"
|
|
|
|
- "<oc:permissions />"
|
|
|
|
- "<oc:size />"
|
|
|
|
- "<oc:favorite/>"
|
|
|
|
- "<nc:is-encrypted/>"
|
|
|
|
- "</d:prop>"
|
|
|
|
- "</d:select>"
|
|
|
|
- "<d:from>"
|
|
|
|
- "<d:scope>"
|
|
|
|
- "<d:href>/files/%@%@</d:href>"
|
|
|
|
- "<d:depth>infinity</d:depth>"
|
|
|
|
- "</d:scope>"
|
|
|
|
- "</d:from>"
|
|
|
|
- "<d:where>"
|
|
|
|
- "<d:like>"
|
|
|
|
- //"<d:prop><d:getcontenttype/></d:prop>"
|
|
|
|
- //"<d:literal>image/%</d:literal>"
|
|
|
|
- "<d:prop><d:displayname/></d:prop>"
|
|
|
|
- "<d:literal>%@</d:literal>"
|
|
|
|
- "</d:like>"
|
|
|
|
- "</d:where>"
|
|
|
|
- "</d:basicsearch>"
|
|
|
|
- "</d:searchrequest>", userID, folder, fileName];
|
|
|
|
|
|
+ if (contentType && dateLastModified) {
|
|
|
|
+
|
|
|
|
+ body = [NSString stringWithFormat: @""
|
|
|
|
+ "<?xml version=\"1.0\"?>"
|
|
|
|
+ "<d:searchrequest xmlns:d=\"DAV:\" xmlns:oc=\"http://owncloud.org/ns\" xmlns:nc=\"http://nextcloud.org/ns\">"
|
|
|
|
+ "<d:basicsearch>"
|
|
|
|
+ "<d:select>"
|
|
|
|
+ "<d:prop>"
|
|
|
|
+ "<d:getlastmodified />"
|
|
|
|
+ "<d:getetag />"
|
|
|
|
+ "<d:getcontenttype />"
|
|
|
|
+ "<d:resourcetype/>"
|
|
|
|
+ "<d:getcontentlength />"
|
|
|
|
+ "<oc:fileid/>"
|
|
|
|
+ "<oc:id/>"
|
|
|
|
+ "<oc:permissions />"
|
|
|
|
+ "<oc:size />"
|
|
|
|
+ "<oc:favorite/>"
|
|
|
|
+ "<nc:is-encrypted/>"
|
|
|
|
+ "</d:prop>"
|
|
|
|
+ "</d:select>"
|
|
|
|
+ "<d:from>"
|
|
|
|
+ "<d:scope>"
|
|
|
|
+ "<d:href>/files/%@</d:href>"
|
|
|
|
+ "<d:depth>infinity</d:depth>"
|
|
|
|
+ "</d:scope>"
|
|
|
|
+ "</d:from>"
|
|
|
|
+ "<d:where><d:and><d:or>", userID];
|
|
|
|
+
|
|
|
|
+ for (NSString *type in contentType) {
|
|
|
|
+ whereType = [NSString stringWithFormat: @"%@<d:like><d:prop><d:getcontenttype/></d:prop><d:literal>%@</d:literal></d:like>", whereType, type];
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ body = [NSString stringWithFormat: @"%@%@</d:or><d:gte><d:prop><d:getlastmodified/></d:prop><d:literal>%@</d:literal></d:gte></d:and></d:where></d:basicsearch></d:searchrequest>", body, whereType, dateLastModified];
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+
|
|
|
|
+ body = [NSString stringWithFormat: @""
|
|
|
|
+ "<?xml version=\"1.0\"?>"
|
|
|
|
+ "<d:searchrequest xmlns:d=\"DAV:\" xmlns:oc=\"http://owncloud.org/ns\" xmlns:nc=\"http://nextcloud.org/ns\">"
|
|
|
|
+ "<d:basicsearch>"
|
|
|
|
+ "<d:select>"
|
|
|
|
+ "<d:prop>"
|
|
|
|
+ "<d:getlastmodified />"
|
|
|
|
+ "<d:getetag />"
|
|
|
|
+ "<d:getcontenttype />"
|
|
|
|
+ "<d:resourcetype/>"
|
|
|
|
+ "<d:getcontentlength />"
|
|
|
|
+ "<oc:fileid/>"
|
|
|
|
+ "<oc:id/>"
|
|
|
|
+ "<oc:permissions />"
|
|
|
|
+ "<oc:size />"
|
|
|
|
+ "<oc:favorite/>"
|
|
|
|
+ "<nc:is-encrypted/>"
|
|
|
|
+ "</d:prop>"
|
|
|
|
+ "</d:select>"
|
|
|
|
+ "<d:from>"
|
|
|
|
+ "<d:scope>"
|
|
|
|
+ "<d:href>/files/%@%@</d:href>"
|
|
|
|
+ "<d:depth>infinity</d:depth>"
|
|
|
|
+ "</d:scope>"
|
|
|
|
+ "</d:from>"
|
|
|
|
+ "<d:where>"
|
|
|
|
+ "<d:like>"
|
|
|
|
+ "<d:prop><d:displayname/></d:prop>"
|
|
|
|
+ "<d:literal>%@</d:literal>"
|
|
|
|
+ "</d:like>"
|
|
|
|
+ "</d:where>"
|
|
|
|
+ "</d:basicsearch>"
|
|
|
|
+ "</d:searchrequest>", userID, folder, fileName];
|
|
|
|
+ }
|
|
|
|
|
|
[request setHTTPBody:[body dataUsingEncoding:NSUTF8StringEncoding]];
|
|
[request setHTTPBody:[body dataUsingEncoding:NSUTF8StringEncoding]];
|
|
[request setValue:@"text/xml" forHTTPHeaderField:@"Content-Type"];
|
|
[request setValue:@"text/xml" forHTTPHeaderField:@"Content-Type"];
|
|
@@ -326,7 +363,7 @@ NSString const *OCWebDAVModificationDateKey = @"modificationdate";
|
|
|
|
|
|
_requestMethod = @"PROPPATCH";
|
|
_requestMethod = @"PROPPATCH";
|
|
|
|
|
|
- NSMutableURLRequest *request = [self requestWithMethod:_requestMethod path:path parameters:nil];
|
|
|
|
|
|
+ NSMutableURLRequest *request = [self requestWithMethod:_requestMethod path:path parameters:nil timeout:k_timeout_webdav];
|
|
|
|
|
|
NSString *body;
|
|
NSString *body;
|
|
body = [NSString stringWithFormat: @""
|
|
body = [NSString stringWithFormat: @""
|
|
@@ -357,7 +394,7 @@ NSString const *OCWebDAVModificationDateKey = @"modificationdate";
|
|
_requestMethod = @"REPORT";
|
|
_requestMethod = @"REPORT";
|
|
|
|
|
|
userID = [userID stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLFragmentAllowedCharacterSet]];
|
|
userID = [userID stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLFragmentAllowedCharacterSet]];
|
|
- NSMutableURLRequest *request = [self requestWithMethod:_requestMethod path:[NSString stringWithFormat:@"%@/files/%@%@", path, userID, folder] parameters:nil];
|
|
|
|
|
|
+ NSMutableURLRequest *request = [self requestWithMethod:_requestMethod path:[NSString stringWithFormat:@"%@/files/%@%@", path, userID, folder] parameters:nil timeout:k_timeout_webdav];
|
|
|
|
|
|
body = [NSString stringWithFormat: @""
|
|
body = [NSString stringWithFormat: @""
|
|
"<?xml version=\"1.0\"?>"
|
|
"<?xml version=\"1.0\"?>"
|
|
@@ -389,7 +426,7 @@ NSString const *OCWebDAVModificationDateKey = @"modificationdate";
|
|
|
|
|
|
- (NSURLSessionDownloadTask *)downloadWithSessionPath:(NSString *)remoteSource toPath:(NSString *)localDestination defaultPriority:(BOOL)defaultPriority onCommunication:(OCCommunication *)sharedOCCommunication progress:(void(^)(NSProgress *progress))downloadProgress success:(void(^)(NSURLResponse *response, NSURL *filePath))success failure:(void(^)(NSURLResponse *response, NSError *error))failure{
|
|
- (NSURLSessionDownloadTask *)downloadWithSessionPath:(NSString *)remoteSource toPath:(NSString *)localDestination defaultPriority:(BOOL)defaultPriority onCommunication:(OCCommunication *)sharedOCCommunication progress:(void(^)(NSProgress *progress))downloadProgress success:(void(^)(NSURLResponse *response, NSURL *filePath))success failure:(void(^)(NSURLResponse *response, NSError *error))failure{
|
|
|
|
|
|
- NSMutableURLRequest *request = [self requestWithMethod:@"GET" path:remoteSource parameters:nil];
|
|
|
|
|
|
+ NSMutableURLRequest *request = [self requestWithMethod:@"GET" path:remoteSource parameters:nil timeout:k_timeout_webdav];
|
|
|
|
|
|
//If is not nil is a redirection so we keep the original url server
|
|
//If is not nil is a redirection so we keep the original url server
|
|
if (!self.originalUrlServer) {
|
|
if (!self.originalUrlServer) {
|
|
@@ -430,7 +467,7 @@ NSString const *OCWebDAVModificationDateKey = @"modificationdate";
|
|
success:(void(^)(NSHTTPURLResponse *, id))success
|
|
success:(void(^)(NSHTTPURLResponse *, id))success
|
|
failure:(void(^)(NSHTTPURLResponse *, id _Nullable responseObject, NSError *))failure {
|
|
failure:(void(^)(NSHTTPURLResponse *, id _Nullable responseObject, NSError *))failure {
|
|
_requestMethod = @"HEAD";
|
|
_requestMethod = @"HEAD";
|
|
- NSMutableURLRequest *request = [self requestWithMethod:_requestMethod path:path parameters:nil];
|
|
|
|
|
|
+ NSMutableURLRequest *request = [self requestWithMethod:_requestMethod path:path parameters:nil timeout:k_timeout_webdav];
|
|
request.HTTPShouldHandleCookies = false;
|
|
request.HTTPShouldHandleCookies = false;
|
|
OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
|
|
OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
|
|
[self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.networkSessionManager];
|
|
[self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.networkSessionManager];
|
|
@@ -442,7 +479,7 @@ NSString const *OCWebDAVModificationDateKey = @"modificationdate";
|
|
success:(void(^)(NSHTTPURLResponse *, id))success
|
|
success:(void(^)(NSHTTPURLResponse *, id))success
|
|
failure:(void(^)(NSHTTPURLResponse *, id _Nullable responseObject, NSError *))failure {
|
|
failure:(void(^)(NSHTTPURLResponse *, id _Nullable responseObject, NSError *))failure {
|
|
_requestMethod = @"MKCOL";
|
|
_requestMethod = @"MKCOL";
|
|
- NSMutableURLRequest *request = [self requestWithMethod:_requestMethod path:path parameters:nil];
|
|
|
|
|
|
+ NSMutableURLRequest *request = [self requestWithMethod:_requestMethod path:path parameters:nil timeout:k_timeout_webdav];
|
|
OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
|
|
OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
|
|
[self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.networkSessionManager];
|
|
[self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.networkSessionManager];
|
|
[operation resume];
|
|
[operation resume];
|
|
@@ -463,7 +500,7 @@ NSString const *OCWebDAVModificationDateKey = @"modificationdate";
|
|
return nil;
|
|
return nil;
|
|
} else {
|
|
} else {
|
|
|
|
|
|
- NSMutableURLRequest *request = [self requestWithMethod:@"PUT" path:remoteDestination parameters:nil];
|
|
|
|
|
|
+ NSMutableURLRequest *request = [self requestWithMethod:@"PUT" path:remoteDestination parameters:nil timeout:k_timeout_webdav];
|
|
[request setTimeoutInterval:k_timeout_upload];
|
|
[request setTimeoutInterval:k_timeout_upload];
|
|
[request setValue:[NSString stringWithFormat:@"%lld", [UtilsFramework getSizeInBytesByPath:localSource]] forHTTPHeaderField:@"Content-Length"];
|
|
[request setValue:[NSString stringWithFormat:@"%lld", [UtilsFramework getSizeInBytesByPath:localSource]] forHTTPHeaderField:@"Content-Length"];
|
|
[request setCachePolicy:NSURLRequestReloadIgnoringLocalCacheData];
|
|
[request setCachePolicy:NSURLRequestReloadIgnoringLocalCacheData];
|
|
@@ -511,7 +548,7 @@ NSString const *OCWebDAVModificationDateKey = @"modificationdate";
|
|
|
|
|
|
_requestMethod = @"GET";
|
|
_requestMethod = @"GET";
|
|
|
|
|
|
- NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path: apiUserUrl parameters: nil];
|
|
|
|
|
|
+ NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path: apiUserUrl parameters: nil timeout:k_timeout_webdav];
|
|
[request setValue:@"application/xml" forHTTPHeaderField:@"Content-Type"];
|
|
[request setValue:@"application/xml" forHTTPHeaderField:@"Content-Type"];
|
|
|
|
|
|
OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
|
|
OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
|
|
@@ -527,7 +564,7 @@ NSString const *OCWebDAVModificationDateKey = @"modificationdate";
|
|
|
|
|
|
_requestMethod = @"GET";
|
|
_requestMethod = @"GET";
|
|
|
|
|
|
- NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path: urlString parameters: nil];
|
|
|
|
|
|
+ NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path: urlString parameters: nil timeout:k_timeout_webdav];
|
|
|
|
|
|
request.HTTPShouldHandleCookies = false;
|
|
request.HTTPShouldHandleCookies = false;
|
|
|
|
|
|
@@ -545,7 +582,7 @@ NSString const *OCWebDAVModificationDateKey = @"modificationdate";
|
|
|
|
|
|
_requestMethod = @"GET";
|
|
_requestMethod = @"GET";
|
|
|
|
|
|
- NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil];
|
|
|
|
|
|
+ NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil timeout:k_timeout_webdav];
|
|
|
|
|
|
OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
|
|
OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
|
|
[self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.networkSessionManager];
|
|
[self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.networkSessionManager];
|
|
@@ -563,7 +600,7 @@ NSString const *OCWebDAVModificationDateKey = @"modificationdate";
|
|
serverPath = [serverPath stringByAppendingString:postString];
|
|
serverPath = [serverPath stringByAppendingString:postString];
|
|
_requestMethod = @"GET";
|
|
_requestMethod = @"GET";
|
|
|
|
|
|
- NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil];
|
|
|
|
|
|
+ NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil timeout:k_timeout_webdav];
|
|
|
|
|
|
OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
|
|
OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
|
|
[self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.networkSessionManager];
|
|
[self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.networkSessionManager];
|
|
@@ -578,7 +615,7 @@ NSString const *OCWebDAVModificationDateKey = @"modificationdate";
|
|
|
|
|
|
_requestMethod = @"POST";
|
|
_requestMethod = @"POST";
|
|
|
|
|
|
- NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil];
|
|
|
|
|
|
+ NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil timeout:k_timeout_webdav];
|
|
_postStringForShare = [NSString stringWithFormat: @"path=%@&shareType=3&password=%@",filePath,password];
|
|
_postStringForShare = [NSString stringWithFormat: @"path=%@&shareType=3&password=%@",filePath,password];
|
|
[request setHTTPBody:[_postStringForShare dataUsingEncoding:NSUTF8StringEncoding]];
|
|
[request setHTTPBody:[_postStringForShare dataUsingEncoding:NSUTF8StringEncoding]];
|
|
|
|
|
|
@@ -595,7 +632,7 @@ NSString const *OCWebDAVModificationDateKey = @"modificationdate";
|
|
|
|
|
|
_requestMethod = @"POST";
|
|
_requestMethod = @"POST";
|
|
|
|
|
|
- NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil];
|
|
|
|
|
|
+ NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil timeout:k_timeout_webdav];
|
|
_postStringForShare = [NSString stringWithFormat: @"path=%@&shareType=3",filePath];
|
|
_postStringForShare = [NSString stringWithFormat: @"path=%@&shareType=3",filePath];
|
|
[request setHTTPBody:[_postStringForShare dataUsingEncoding:NSUTF8StringEncoding]];
|
|
[request setHTTPBody:[_postStringForShare dataUsingEncoding:NSUTF8StringEncoding]];
|
|
|
|
|
|
@@ -611,7 +648,7 @@ NSString const *OCWebDAVModificationDateKey = @"modificationdate";
|
|
|
|
|
|
_requestMethod = @"POST";
|
|
_requestMethod = @"POST";
|
|
|
|
|
|
- NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil];
|
|
|
|
|
|
+ NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil timeout:k_timeout_webdav];
|
|
|
|
|
|
self.postStringForShare = [NSString stringWithFormat: @"path=%@&shareType=%ld&shareWith=%@&permissions=%ld",filePath, (long)shareeType, userOrGroup, (long)permissions];
|
|
self.postStringForShare = [NSString stringWithFormat: @"path=%@&shareType=%ld&shareWith=%@&permissions=%ld",filePath, (long)shareeType, userOrGroup, (long)permissions];
|
|
[request setHTTPBody:[_postStringForShare dataUsingEncoding:NSUTF8StringEncoding]];
|
|
[request setHTTPBody:[_postStringForShare dataUsingEncoding:NSUTF8StringEncoding]];
|
|
@@ -630,7 +667,7 @@ NSString const *OCWebDAVModificationDateKey = @"modificationdate";
|
|
|
|
|
|
_requestMethod = @"DELETE";
|
|
_requestMethod = @"DELETE";
|
|
|
|
|
|
- NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil];
|
|
|
|
|
|
+ NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil timeout:k_timeout_webdav];
|
|
|
|
|
|
OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
|
|
OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
|
|
[self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.networkSessionManager];
|
|
[self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.networkSessionManager];
|
|
@@ -646,7 +683,7 @@ NSString const *OCWebDAVModificationDateKey = @"modificationdate";
|
|
|
|
|
|
_requestMethod = @"GET";
|
|
_requestMethod = @"GET";
|
|
|
|
|
|
- NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil];
|
|
|
|
|
|
+ NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil timeout:k_timeout_webdav];
|
|
|
|
|
|
OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
|
|
OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
|
|
[self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.networkSessionManager];
|
|
[self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.networkSessionManager];
|
|
@@ -662,7 +699,7 @@ NSString const *OCWebDAVModificationDateKey = @"modificationdate";
|
|
|
|
|
|
_requestMethod = @"PUT";
|
|
_requestMethod = @"PUT";
|
|
|
|
|
|
- NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil];
|
|
|
|
|
|
+ NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil timeout:k_timeout_webdav];
|
|
|
|
|
|
if (password) {
|
|
if (password) {
|
|
self.postStringForShare = [NSString stringWithFormat:@"password=%@",password];
|
|
self.postStringForShare = [NSString stringWithFormat:@"password=%@",password];
|
|
@@ -695,7 +732,7 @@ NSString const *OCWebDAVModificationDateKey = @"modificationdate";
|
|
serverPath = [serverPath stringByAppendingString:searchQuery];
|
|
serverPath = [serverPath stringByAppendingString:searchQuery];
|
|
serverPath = [serverPath stringByAppendingString:pagination];
|
|
serverPath = [serverPath stringByAppendingString:pagination];
|
|
|
|
|
|
- NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil];
|
|
|
|
|
|
+ NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil timeout:k_timeout_webdav];
|
|
|
|
|
|
OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
|
|
OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
|
|
[self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.networkSessionManager];
|
|
[self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.networkSessionManager];
|
|
@@ -709,7 +746,7 @@ NSString const *OCWebDAVModificationDateKey = @"modificationdate";
|
|
NSParameterAssert(success);
|
|
NSParameterAssert(success);
|
|
|
|
|
|
_requestMethod = @"PROPFIND";
|
|
_requestMethod = @"PROPFIND";
|
|
- NSMutableURLRequest *request = [self requestWithMethod:_requestMethod path:fileName parameters:nil];
|
|
|
|
|
|
+ NSMutableURLRequest *request = [self requestWithMethod:_requestMethod path:fileName parameters:nil timeout:k_timeout_webdav];
|
|
|
|
|
|
[request setHTTPBody:[@"<?xml version=\"1.0\" encoding=\"UTF-8\"?><a:propfind xmlns:a=\"DAV:\" xmlns:b=\"http://open-collaboration-services.org/ns\"><a:prop><b:share-permissions/></a:prop></a:propfind>" dataUsingEncoding:NSUTF8StringEncoding]];
|
|
[request setHTTPBody:[@"<?xml version=\"1.0\" encoding=\"UTF-8\"?><a:propfind xmlns:a=\"DAV:\" xmlns:b=\"http://open-collaboration-services.org/ns\"><a:prop><b:share-permissions/></a:prop></a:propfind>" dataUsingEncoding:NSUTF8StringEncoding]];
|
|
|
|
|
|
@@ -727,7 +764,7 @@ NSString const *OCWebDAVModificationDateKey = @"modificationdate";
|
|
|
|
|
|
serverPath = [serverPath stringByAppendingString:[NSString stringWithFormat:@"?format=json"]];
|
|
serverPath = [serverPath stringByAppendingString:[NSString stringWithFormat:@"?format=json"]];
|
|
|
|
|
|
- NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil];
|
|
|
|
|
|
+ NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil timeout:k_timeout_webdav];
|
|
|
|
|
|
OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
|
|
OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
|
|
[self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.networkSessionManager];
|
|
[self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.networkSessionManager];
|
|
@@ -745,7 +782,7 @@ NSString const *OCWebDAVModificationDateKey = @"modificationdate";
|
|
NSString *query = [NSString stringWithFormat:@"/%i/%i/%@", (int)fileWidth, (int)fileHeight, filePath];
|
|
NSString *query = [NSString stringWithFormat:@"/%i/%i/%@", (int)fileWidth, (int)fileHeight, filePath];
|
|
serverPath = [serverPath stringByAppendingString:query];
|
|
serverPath = [serverPath stringByAppendingString:query];
|
|
|
|
|
|
- NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil];
|
|
|
|
|
|
+ NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil timeout:k_timeout_webdav];
|
|
|
|
|
|
OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
|
|
OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
|
|
[self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.networkSessionManager];
|
|
[self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.networkSessionManager];
|
|
@@ -762,7 +799,7 @@ NSString const *OCWebDAVModificationDateKey = @"modificationdate";
|
|
|
|
|
|
serverPath = [serverPath stringByAppendingString:[NSString stringWithFormat:@"?format=json"]];
|
|
serverPath = [serverPath stringByAppendingString:[NSString stringWithFormat:@"?format=json"]];
|
|
|
|
|
|
- NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil];
|
|
|
|
|
|
+ NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil timeout:k_timeout_webdav];
|
|
|
|
|
|
OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
|
|
OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
|
|
[self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.networkSessionManager];
|
|
[self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.networkSessionManager];
|
|
@@ -775,7 +812,7 @@ NSString const *OCWebDAVModificationDateKey = @"modificationdate";
|
|
|
|
|
|
_requestMethod = type;
|
|
_requestMethod = type;
|
|
|
|
|
|
- NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil];
|
|
|
|
|
|
+ NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil timeout:k_timeout_webdav];
|
|
|
|
|
|
OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
|
|
OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
|
|
[self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.networkSessionManager];
|
|
[self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.networkSessionManager];
|
|
@@ -796,7 +833,7 @@ NSString const *OCWebDAVModificationDateKey = @"modificationdate";
|
|
serverPath = [serverPath stringByAppendingString:devicePublicKeyParam];
|
|
serverPath = [serverPath stringByAppendingString:devicePublicKeyParam];
|
|
serverPath = [serverPath stringByAppendingString:proxyServerPathParam];
|
|
serverPath = [serverPath stringByAppendingString:proxyServerPathParam];
|
|
|
|
|
|
- NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil];
|
|
|
|
|
|
+ NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil timeout:k_timeout_webdav];
|
|
[request setValue:[NSString stringWithFormat:@"token %@", authorizationToken] forHTTPHeaderField:@"Authorization"];
|
|
[request setValue:[NSString stringWithFormat:@"token %@", authorizationToken] forHTTPHeaderField:@"Authorization"];
|
|
|
|
|
|
OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
|
|
OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
|
|
@@ -820,7 +857,7 @@ NSString const *OCWebDAVModificationDateKey = @"modificationdate";
|
|
serverPath = [serverPath stringByAppendingString:deviceIdentifierSignature];
|
|
serverPath = [serverPath stringByAppendingString:deviceIdentifierSignature];
|
|
serverPath = [serverPath stringByAppendingString:userPublicKey];
|
|
serverPath = [serverPath stringByAppendingString:userPublicKey];
|
|
|
|
|
|
- NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil];
|
|
|
|
|
|
+ NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil timeout:k_timeout_webdav];
|
|
|
|
|
|
[request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
|
|
[request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
|
|
|
|
|
|
@@ -838,7 +875,7 @@ NSString const *OCWebDAVModificationDateKey = @"modificationdate";
|
|
|
|
|
|
serverPath = [serverPath stringByAppendingString:[NSString stringWithFormat:@"?format=json"]];
|
|
serverPath = [serverPath stringByAppendingString:[NSString stringWithFormat:@"?format=json"]];
|
|
|
|
|
|
- NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil];
|
|
|
|
|
|
+ NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil timeout:k_timeout_webdav];
|
|
|
|
|
|
OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
|
|
OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
|
|
[self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.networkSessionManager];
|
|
[self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.networkSessionManager];
|
|
@@ -854,7 +891,7 @@ NSString const *OCWebDAVModificationDateKey = @"modificationdate";
|
|
|
|
|
|
serverPath = [serverPath stringByAppendingString:[NSString stringWithFormat:@"?format=json"]];
|
|
serverPath = [serverPath stringByAppendingString:[NSString stringWithFormat:@"?format=json"]];
|
|
|
|
|
|
- NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil];
|
|
|
|
|
|
+ NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil timeout:k_timeout_webdav];
|
|
|
|
|
|
OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
|
|
OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
|
|
[self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.networkSessionManager];
|
|
[self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.networkSessionManager];
|
|
@@ -870,7 +907,7 @@ NSString const *OCWebDAVModificationDateKey = @"modificationdate";
|
|
|
|
|
|
serverPath = [serverPath stringByAppendingString:[NSString stringWithFormat:@"?format=json"]];
|
|
serverPath = [serverPath stringByAppendingString:[NSString stringWithFormat:@"?format=json"]];
|
|
|
|
|
|
- NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil];
|
|
|
|
|
|
+ NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil timeout:k_timeout_webdav];
|
|
OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
|
|
OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
|
|
[self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.networkSessionManager];
|
|
[self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.networkSessionManager];
|
|
|
|
|
|
@@ -884,7 +921,7 @@ NSString const *OCWebDAVModificationDateKey = @"modificationdate";
|
|
|
|
|
|
_requestMethod = @"GET";
|
|
_requestMethod = @"GET";
|
|
|
|
|
|
- NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil];
|
|
|
|
|
|
+ NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil timeout:k_timeout_webdav];
|
|
[request setValue:@"true" forHTTPHeaderField:@"OCS-APIRequest"];
|
|
[request setValue:@"true" forHTTPHeaderField:@"OCS-APIRequest"];
|
|
|
|
|
|
OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
|
|
OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
|
|
@@ -898,7 +935,7 @@ NSString const *OCWebDAVModificationDateKey = @"modificationdate";
|
|
|
|
|
|
_requestMethod = @"GET";
|
|
_requestMethod = @"GET";
|
|
|
|
|
|
- NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil];
|
|
|
|
|
|
+ NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil timeout:k_timeout_webdav];
|
|
[request setValue:@"true" forHTTPHeaderField:@"OCS-APIRequest"];
|
|
[request setValue:@"true" forHTTPHeaderField:@"OCS-APIRequest"];
|
|
|
|
|
|
OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
|
|
OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
|
|
@@ -912,7 +949,7 @@ NSString const *OCWebDAVModificationDateKey = @"modificationdate";
|
|
|
|
|
|
_requestMethod = @"GET";
|
|
_requestMethod = @"GET";
|
|
|
|
|
|
- NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil];
|
|
|
|
|
|
+ NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil timeout:k_timeout_webdav];
|
|
[request setValue:@"true" forHTTPHeaderField:@"OCS-APIRequest"];
|
|
[request setValue:@"true" forHTTPHeaderField:@"OCS-APIRequest"];
|
|
|
|
|
|
OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
|
|
OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
|
|
@@ -928,7 +965,7 @@ NSString const *OCWebDAVModificationDateKey = @"modificationdate";
|
|
|
|
|
|
_requestMethod = @"POST";
|
|
_requestMethod = @"POST";
|
|
|
|
|
|
- NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil];
|
|
|
|
|
|
+ NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil timeout:k_timeout_webdav];
|
|
[request setValue:@"true" forHTTPHeaderField:@"OCS-APIRequest"];
|
|
[request setValue:@"true" forHTTPHeaderField:@"OCS-APIRequest"];
|
|
|
|
|
|
_postStringKey = [NSString stringWithFormat: @"csr=%@",key];
|
|
_postStringKey = [NSString stringWithFormat: @"csr=%@",key];
|
|
@@ -947,7 +984,7 @@ NSString const *OCWebDAVModificationDateKey = @"modificationdate";
|
|
|
|
|
|
_requestMethod = @"POST";
|
|
_requestMethod = @"POST";
|
|
|
|
|
|
- NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil];
|
|
|
|
|
|
+ NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil timeout:k_timeout_webdav];
|
|
[request setValue:@"true" forHTTPHeaderField:@"OCS-APIRequest"];
|
|
[request setValue:@"true" forHTTPHeaderField:@"OCS-APIRequest"];
|
|
|
|
|
|
_postStringKey = [NSString stringWithFormat: @"privateKey=%@",key];
|
|
_postStringKey = [NSString stringWithFormat: @"privateKey=%@",key];
|
|
@@ -964,7 +1001,7 @@ NSString const *OCWebDAVModificationDateKey = @"modificationdate";
|
|
|
|
|
|
_requestMethod = @"DELETE";
|
|
_requestMethod = @"DELETE";
|
|
|
|
|
|
- NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil];
|
|
|
|
|
|
+ NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil timeout:k_timeout_webdav];
|
|
[request setValue:@"true" forHTTPHeaderField:@"OCS-APIRequest"];
|
|
[request setValue:@"true" forHTTPHeaderField:@"OCS-APIRequest"];
|
|
|
|
|
|
OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
|
|
OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
|
|
@@ -978,7 +1015,7 @@ NSString const *OCWebDAVModificationDateKey = @"modificationdate";
|
|
|
|
|
|
_requestMethod = @"DELETE";
|
|
_requestMethod = @"DELETE";
|
|
|
|
|
|
- NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil];
|
|
|
|
|
|
+ NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil timeout:k_timeout_webdav];
|
|
[request setValue:@"true" forHTTPHeaderField:@"OCS-APIRequest"];
|
|
[request setValue:@"true" forHTTPHeaderField:@"OCS-APIRequest"];
|
|
|
|
|
|
OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
|
|
OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
|
|
@@ -992,7 +1029,7 @@ NSString const *OCWebDAVModificationDateKey = @"modificationdate";
|
|
|
|
|
|
_requestMethod = @"PUT";
|
|
_requestMethod = @"PUT";
|
|
|
|
|
|
- NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil];
|
|
|
|
|
|
+ NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil timeout:k_timeout_webdav];
|
|
[request setValue:@"true" forHTTPHeaderField:@"OCS-APIRequest"];
|
|
[request setValue:@"true" forHTTPHeaderField:@"OCS-APIRequest"];
|
|
|
|
|
|
OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
|
|
OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
|
|
@@ -1006,7 +1043,7 @@ NSString const *OCWebDAVModificationDateKey = @"modificationdate";
|
|
|
|
|
|
_requestMethod = @"DELETE";
|
|
_requestMethod = @"DELETE";
|
|
|
|
|
|
- NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil];
|
|
|
|
|
|
+ NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil timeout:k_timeout_webdav];
|
|
[request setValue:@"true" forHTTPHeaderField:@"OCS-APIRequest"];
|
|
[request setValue:@"true" forHTTPHeaderField:@"OCS-APIRequest"];
|
|
|
|
|
|
OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
|
|
OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
|
|
@@ -1020,7 +1057,7 @@ NSString const *OCWebDAVModificationDateKey = @"modificationdate";
|
|
|
|
|
|
_requestMethod = @"POST";
|
|
_requestMethod = @"POST";
|
|
|
|
|
|
- NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil];
|
|
|
|
|
|
+ NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil timeout:k_timeout_webdav];
|
|
[request setValue:@"true" forHTTPHeaderField:@"OCS-APIRequest"];
|
|
[request setValue:@"true" forHTTPHeaderField:@"OCS-APIRequest"];
|
|
|
|
|
|
OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
|
|
OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
|
|
@@ -1034,7 +1071,7 @@ NSString const *OCWebDAVModificationDateKey = @"modificationdate";
|
|
|
|
|
|
_requestMethod = @"DELETE";
|
|
_requestMethod = @"DELETE";
|
|
|
|
|
|
- NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil];
|
|
|
|
|
|
+ NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil timeout:k_timeout_webdav];
|
|
[request setValue:@"true" forHTTPHeaderField:@"OCS-APIRequest"];
|
|
[request setValue:@"true" forHTTPHeaderField:@"OCS-APIRequest"];
|
|
|
|
|
|
// Add token
|
|
// Add token
|
|
@@ -1053,7 +1090,7 @@ NSString const *OCWebDAVModificationDateKey = @"modificationdate";
|
|
|
|
|
|
_requestMethod = @"GET";
|
|
_requestMethod = @"GET";
|
|
|
|
|
|
- NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil];
|
|
|
|
|
|
+ NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil timeout:k_timeout_webdav];
|
|
[request setValue:@"true" forHTTPHeaderField:@"OCS-APIRequest"];
|
|
[request setValue:@"true" forHTTPHeaderField:@"OCS-APIRequest"];
|
|
|
|
|
|
OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
|
|
OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
|
|
@@ -1069,7 +1106,7 @@ NSString const *OCWebDAVModificationDateKey = @"modificationdate";
|
|
|
|
|
|
_requestMethod = @"POST";
|
|
_requestMethod = @"POST";
|
|
|
|
|
|
- NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil];
|
|
|
|
|
|
+ NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil timeout:k_timeout_webdav];
|
|
[request setValue:@"true" forHTTPHeaderField:@"OCS-APIRequest"];
|
|
[request setValue:@"true" forHTTPHeaderField:@"OCS-APIRequest"];
|
|
|
|
|
|
_postStringMetadata = [NSString stringWithFormat: @"metaData=%@",metadata];
|
|
_postStringMetadata = [NSString stringWithFormat: @"metaData=%@",metadata];
|
|
@@ -1088,7 +1125,7 @@ NSString const *OCWebDAVModificationDateKey = @"modificationdate";
|
|
|
|
|
|
_requestMethod = @"PUT";
|
|
_requestMethod = @"PUT";
|
|
|
|
|
|
- NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil];
|
|
|
|
|
|
+ NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil timeout:k_timeout_webdav];
|
|
[request setValue:@"true" forHTTPHeaderField:@"OCS-APIRequest"];
|
|
[request setValue:@"true" forHTTPHeaderField:@"OCS-APIRequest"];
|
|
|
|
|
|
_postStringMetadata = [NSString stringWithFormat: @"metaData=%@",metadata];
|
|
_postStringMetadata = [NSString stringWithFormat: @"metaData=%@",metadata];
|
|
@@ -1107,7 +1144,7 @@ NSString const *OCWebDAVModificationDateKey = @"modificationdate";
|
|
|
|
|
|
_requestMethod = @"DELETE";
|
|
_requestMethod = @"DELETE";
|
|
|
|
|
|
- NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil];
|
|
|
|
|
|
+ NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil timeout:k_timeout_webdav];
|
|
[request setValue:@"true" forHTTPHeaderField:@"OCS-APIRequest"];
|
|
[request setValue:@"true" forHTTPHeaderField:@"OCS-APIRequest"];
|
|
|
|
|
|
OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
|
|
OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
|
|
@@ -1152,7 +1189,7 @@ NSString const *OCWebDAVModificationDateKey = @"modificationdate";
|
|
|
|
|
|
if (_postStringForShare) {
|
|
if (_postStringForShare) {
|
|
//It is a request to share a file by link
|
|
//It is a request to share a file by link
|
|
- requestRedirect = [self sharedRequestWithMethod:_requestMethod path:responseURLString parameters:nil];
|
|
|
|
|
|
+ requestRedirect = [self sharedRequestWithMethod:_requestMethod path:responseURLString parameters:nil timeout:k_timeout_webdav];
|
|
[requestRedirect setHTTPBody:[_postStringForShare dataUsingEncoding:NSUTF8StringEncoding]];
|
|
[requestRedirect setHTTPBody:[_postStringForShare dataUsingEncoding:NSUTF8StringEncoding]];
|
|
}
|
|
}
|
|
|
|
|