|
@@ -258,7 +258,7 @@ NSString const *OCWebDAVModificationDateKey = @"modificationdate";
|
|
|
[operation resume];
|
|
|
}
|
|
|
|
|
|
-- (void)mr_search:(NSString *)path fileName:(NSString *)fileName depth:(NSString *)depth withUserSessionToken:(NSString*)token onCommunication:
|
|
|
+- (void)mr_search:(NSString *)path fileName:(NSString *)fileName depth:(NSString *)depth user:(NSString *)user withUserSessionToken:(NSString*)token onCommunication:
|
|
|
(OCCommunication *)sharedOCCommunication
|
|
|
success:(void(^)(NSHTTPURLResponse *operation, id response, NSString *token))success
|
|
|
failure:(void(^)(NSHTTPURLResponse *response, id _Nullable responseObject, NSError *, NSString *token))failure {
|
|
@@ -267,7 +267,7 @@ NSString const *OCWebDAVModificationDateKey = @"modificationdate";
|
|
|
_requestMethod = @"SEARCH";
|
|
|
NSMutableURLRequest *request = [self requestWithMethod:_requestMethod path:path parameters:nil];
|
|
|
|
|
|
- NSString *body = [NSString stringWithFormat:@"<?xml version=\"1.0\"?><d:searchrequest xmlns:d=\"DAV:\" xmlns:oc=\"http://owncloud.org/ns\"><d:basicsearch><d:select><d:prop><d:displayname/></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>",@"admin",fileName];
|
|
|
+ NSString *body = [NSString stringWithFormat:@"<?xml version=\"1.0\"?><d:searchrequest xmlns:d=\"DAV:\" xmlns:oc=\"http://owncloud.org/ns\"><d:basicsearch><d:select><d:prop><d:displayname/></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>", user, fileName];
|
|
|
|
|
|
[request setHTTPBody:[body dataUsingEncoding:NSUTF8StringEncoding]];
|
|
|
|
|
@@ -299,11 +299,11 @@ NSString const *OCWebDAVModificationDateKey = @"modificationdate";
|
|
|
[self mr_listPath:path depth:1 withUserSessionToken:token onCommunication:sharedOCCommunication success:success failure:failure];
|
|
|
}
|
|
|
|
|
|
-- (void)search:(NSString *)path fileName:(NSString *)fileName depth:(NSString *)depth
|
|
|
+- (void)search:(NSString *)path fileName:(NSString *)fileName depth:(NSString *)depth user:(NSString *)user
|
|
|
onCommunication:(OCCommunication *)sharedOCCommunication withUserSessionToken:(NSString *)token
|
|
|
success:(void(^)(NSHTTPURLResponse *, id, NSString *token))success
|
|
|
failure:(void(^)(NSHTTPURLResponse *, id _Nullable responseObject, NSError *, NSString *token))failure {
|
|
|
- [self mr_search:path fileName:fileName depth:depth withUserSessionToken:token onCommunication:sharedOCCommunication success:success failure:failure];
|
|
|
+ [self mr_search:path fileName:fileName depth:depth user:user withUserSessionToken:token onCommunication:sharedOCCommunication success:success failure: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{
|