|
@@ -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]];
|
|
@@ -274,7 +274,7 @@ NSString const *OCWebDAVModificationDateKey = @"modificationdate";
|
|
|
|
|
|
_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];
|
|
|
|
|
|
if (contentType) {
|
|
if (contentType) {
|
|
|
|
|
|
@@ -365,7 +365,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: @""
|
|
@@ -396,7 +396,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\"?>"
|
|
@@ -428,7 +428,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) {
|
|
@@ -469,7 +469,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];
|
|
@@ -481,7 +481,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];
|
|
@@ -502,7 +502,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];
|
|
@@ -550,7 +550,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];
|
|
@@ -566,7 +566,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;
|
|
|
|
|
|
@@ -584,7 +584,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];
|
|
@@ -602,7 +602,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];
|
|
@@ -617,7 +617,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]];
|
|
|
|
|
|
@@ -634,7 +634,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]];
|
|
|
|
|
|
@@ -650,7 +650,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]];
|
|
@@ -669,7 +669,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];
|
|
@@ -685,7 +685,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];
|
|
@@ -701,7 +701,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];
|
|
@@ -734,7 +734,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];
|
|
@@ -748,7 +748,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]];
|
|
|
|
|
|
@@ -766,7 +766,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];
|
|
@@ -784,7 +784,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];
|
|
@@ -801,7 +801,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];
|
|
@@ -814,7 +814,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];
|
|
@@ -835,7 +835,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];
|
|
@@ -859,7 +859,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"];
|
|
|
|
|
|
@@ -877,7 +877,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];
|
|
@@ -893,7 +893,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];
|
|
@@ -909,7 +909,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];
|
|
|
|
|
|
@@ -923,7 +923,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];
|
|
@@ -937,7 +937,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];
|
|
@@ -951,7 +951,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];
|
|
@@ -967,7 +967,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];
|
|
@@ -986,7 +986,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];
|
|
@@ -1003,7 +1003,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];
|
|
@@ -1017,7 +1017,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];
|
|
@@ -1031,7 +1031,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];
|
|
@@ -1045,7 +1045,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];
|
|
@@ -1059,7 +1059,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];
|
|
@@ -1073,7 +1073,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
|
|
@@ -1092,7 +1092,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];
|
|
@@ -1108,7 +1108,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];
|
|
@@ -1127,7 +1127,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];
|
|
@@ -1146,7 +1146,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];
|
|
@@ -1191,7 +1191,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]];
|
|
}
|
|
}
|
|
|
|
|