|
@@ -36,10 +36,8 @@
|
|
|
#import "OCCommunication.h"
|
|
|
#import "OCHTTPRequestOperation.h"
|
|
|
#import "UtilsFramework.h"
|
|
|
-#import "OCXMLParser.h"
|
|
|
#import "OCXMLSharedParser.h"
|
|
|
#import "OCXMLServerErrorsParser.h"
|
|
|
-#import "OCXMLListParser.h"
|
|
|
#import "NSString+Encode.h"
|
|
|
#import "OCFrameworkConstants.h"
|
|
|
#import "OCWebDAVClient.h"
|
|
@@ -56,6 +54,7 @@
|
|
|
#import "NCRichDocumentTemplate.h"
|
|
|
#import "HCFeatures.h"
|
|
|
#import "NCXMLCommentsParser.h"
|
|
|
+#import "NCXMLListParser.h"
|
|
|
|
|
|
@interface OCCommunication ()
|
|
|
|
|
@@ -448,12 +447,13 @@
|
|
|
// NSString* newStr = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];
|
|
|
// NSLog(@"newStrReadFolder: %@", newStr);
|
|
|
|
|
|
- OCXMLParser *parser = [[OCXMLParser alloc]init];
|
|
|
- [parser initParserWithData:responseData];
|
|
|
- NSMutableArray *directoryList = [parser.directoryList mutableCopy];
|
|
|
|
|
|
+ NCXMLListParser *parser = [NCXMLListParser new];
|
|
|
+ [parser initParserWithData:responseData controlFirstFileOfList:true];
|
|
|
+ NSMutableArray *list = [parser.list mutableCopy];
|
|
|
+
|
|
|
//Return success
|
|
|
- successRequest(response, directoryList, request.redirectedServer, token);
|
|
|
+ successRequest(response, list, request.redirectedServer, token);
|
|
|
}
|
|
|
|
|
|
} failure:^(NSHTTPURLResponse *response, id responseData, NSError *error, NSString *token) {
|
|
@@ -462,130 +462,6 @@
|
|
|
}];
|
|
|
}
|
|
|
|
|
|
-///-----------------------------------
|
|
|
-/// @name Download File Session
|
|
|
-///-----------------------------------
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-- (NSURLSessionDownloadTask *) downloadFileSession:(NSString *)remotePath toDestiny:(NSString *)localPath defaultPriority:(BOOL)defaultPriority encode:(BOOL)encode onCommunication:(OCCommunication *)sharedOCCommunication progress:(void(^)(NSProgress *progress))downloadProgress successRequest:(void(^)(NSURLResponse *response, NSURL *filePath)) successRequest failureRequest:(void(^)(NSURLResponse *response, NSError *error)) failureRequest {
|
|
|
-
|
|
|
- OCWebDAVClient *request = [OCWebDAVClient new];
|
|
|
- request = [self getRequestWithCredentials:request];
|
|
|
- if (encode) remotePath = [remotePath encodeString:NSUTF8StringEncoding];
|
|
|
-
|
|
|
- NSURLSessionDownloadTask *downloadTask = [request downloadWithSessionPath:remotePath toPath:localPath defaultPriority:defaultPriority onCommunication:sharedOCCommunication progress:^(NSProgress *progress) {
|
|
|
- downloadProgress(progress);
|
|
|
- } success:^(NSURLResponse *response, NSURL *filePath) {
|
|
|
-
|
|
|
- [UtilsFramework addCookiesToStorageFromResponse:(NSURLResponse *) response andPath:[NSURL URLWithString:remotePath]];
|
|
|
- successRequest(response,filePath);
|
|
|
-
|
|
|
- } failure:^(NSURLResponse *response, NSError *error) {
|
|
|
- [UtilsFramework addCookiesToStorageFromResponse:(NSURLResponse *) response andPath:[NSURL URLWithString:remotePath]];
|
|
|
- failureRequest(response,error);
|
|
|
- }];
|
|
|
-
|
|
|
- return downloadTask;
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-///-----------------------------------
|
|
|
-/// @name Set Download Task Complete Block
|
|
|
-///-----------------------------------
|
|
|
-
|
|
|
-
|
|
|
-- (void)setDownloadTaskComleteBlock: (NSURL * (^)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, NSURL *location))block{
|
|
|
-
|
|
|
- [self.downloadSessionManager setDownloadTaskDidFinishDownloadingBlock:block];
|
|
|
-
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-///-----------------------------------
|
|
|
-/// @name Set Download Task Did Get Body Data Block
|
|
|
-///-----------------------------------
|
|
|
-
|
|
|
-
|
|
|
-- (void) setDownloadTaskDidGetBodyDataBlock: (void(^)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, int64_t bytesWritten, int64_t totalBytesWritten, int64_t totalBytesExpectedToWrite)) block{
|
|
|
-
|
|
|
- [self.downloadSessionManager setDownloadTaskDidWriteDataBlock:^(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, int64_t bytesWritten, int64_t totalBytesWritten, int64_t totalBytesExpectedToWrite) {
|
|
|
- block(session,downloadTask,bytesWritten,totalBytesWritten,totalBytesExpectedToWrite);
|
|
|
- }];
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
-///-----------------------------------
|
|
|
-/// @name Upload File Session
|
|
|
-///-----------------------------------
|
|
|
-
|
|
|
-- (NSURLSessionUploadTask *) uploadFileSession:(NSString *) localPath toDestiny:(NSString *) remotePath onCommunication:(OCCommunication *)sharedOCCommunication progress:(void(^)(NSProgress *progress))uploadProgress successRequest:(void(^)(NSURLResponse *response, NSString *redirectedServer)) successRequest failureRequest:(void(^)(NSURLResponse *response, NSString *redirectedServer, NSError *error)) failureRequest failureBeforeRequest:(void(^)(NSError *error)) failureBeforeRequest {
|
|
|
-
|
|
|
- OCWebDAVClient *request = [OCWebDAVClient new];
|
|
|
- request = [self getRequestWithCredentials:request];
|
|
|
-
|
|
|
-
|
|
|
- remotePath = [remotePath encodeString:NSUTF8StringEncoding];
|
|
|
-
|
|
|
- NSURLSessionUploadTask *uploadTask = [request putWithSessionLocalPath:localPath atRemotePath:remotePath onCommunication:sharedOCCommunication progress:^(NSProgress *progress) {
|
|
|
- uploadProgress(progress);
|
|
|
- } success:^(NSURLResponse *response, id responseObjec){
|
|
|
- [UtilsFramework addCookiesToStorageFromResponse:(NSURLResponse *) response andPath:[NSURL URLWithString:remotePath]];
|
|
|
- //TODO: The second parameter is the redirected server
|
|
|
- successRequest(response, @"");
|
|
|
- } failure:^(NSURLResponse *response, id responseObject, NSError *error) {
|
|
|
- [UtilsFramework addCookiesToStorageFromResponse:(NSURLResponse *) response andPath:[NSURL URLWithString:remotePath]];
|
|
|
- //TODO: The second parameter is the redirected server
|
|
|
-
|
|
|
- NSData *responseData = (NSData*) responseObject;
|
|
|
-
|
|
|
- OCXMLServerErrorsParser *serverErrorParser = [OCXMLServerErrorsParser new];
|
|
|
-
|
|
|
- [serverErrorParser startToParseWithData:responseData withCompleteBlock:^(NSError *err) {
|
|
|
-
|
|
|
- if (err) {
|
|
|
- failureRequest(response, @"", err);
|
|
|
- }else{
|
|
|
- failureRequest(response, @"", error);
|
|
|
- }
|
|
|
-
|
|
|
- }];
|
|
|
-
|
|
|
- } failureBeforeRequest:^(NSError *error) {
|
|
|
- failureBeforeRequest(error);
|
|
|
- }];
|
|
|
-
|
|
|
- return uploadTask;
|
|
|
-}
|
|
|
-
|
|
|
-///-----------------------------------
|
|
|
-/// @name Set Task Did Complete Block
|
|
|
-///-----------------------------------
|
|
|
-
|
|
|
-- (void) setTaskDidCompleteBlock: (void(^)(NSURLSession *session, NSURLSessionTask *task, NSError *error)) block{
|
|
|
-
|
|
|
- [self.uploadSessionManager setTaskDidCompleteBlock:^(NSURLSession *session, NSURLSessionTask *task, NSError *error) {
|
|
|
-
|
|
|
- block(session, task, error);
|
|
|
- }];
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-///-----------------------------------
|
|
|
-/// @name Set Task Did Send Body Data Block
|
|
|
-///-----------------------------------
|
|
|
-
|
|
|
-
|
|
|
-- (void) setTaskDidSendBodyDataBlock: (void(^)(NSURLSession *session, NSURLSessionTask *task, int64_t bytesSent, int64_t totalBytesSent, int64_t totalBytesExpectedToSend)) block{
|
|
|
-
|
|
|
- [self.uploadSessionManager setTaskDidSendBodyDataBlock:^(NSURLSession *session, NSURLSessionTask *task, int64_t bytesSent, int64_t totalBytesSent, int64_t totalBytesExpectedToSend) {
|
|
|
- block(session, task, bytesSent, totalBytesSent, totalBytesExpectedToSend);
|
|
|
- }];
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
///-----------------------------------
|
|
|
/// @name Read File
|
|
|
///-----------------------------------
|
|
@@ -605,15 +481,15 @@
|
|
|
if (successRequest) {
|
|
|
NSData *responseData = (NSData*) responseObject;
|
|
|
|
|
|
-// NSString* newStr = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];
|
|
|
-// NSLog(@"newStrReadFile: %@", newStr);
|
|
|
-
|
|
|
- OCXMLParser *parser = [[OCXMLParser alloc]init];
|
|
|
- [parser initParserWithData:responseData];
|
|
|
- NSMutableArray *directoryList = [parser.directoryList mutableCopy];
|
|
|
+ // NSString* newStr = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];
|
|
|
+ // NSLog(@"newStrReadFile: %@", newStr);
|
|
|
+
|
|
|
+ NCXMLListParser *parser = [NCXMLListParser new];
|
|
|
+ [parser initParserWithData:responseData controlFirstFileOfList:true];
|
|
|
+ NSMutableArray *list = [parser.list mutableCopy];
|
|
|
|
|
|
//Return success
|
|
|
- successRequest(response, directoryList, request.redirectedServer);
|
|
|
+ successRequest(response, list, request.redirectedServer);
|
|
|
}
|
|
|
|
|
|
} failure:^(NSHTTPURLResponse *response, NSData *responseData, NSError *error) {
|
|
@@ -642,16 +518,16 @@
|
|
|
if (successRequest) {
|
|
|
|
|
|
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{
|
|
|
-
|
|
|
+
|
|
|
NSData *responseData = (NSData*) responseObject;
|
|
|
-
|
|
|
- OCXMLListParser *parser = [OCXMLListParser new];
|
|
|
- [parser initParserWithData:responseData];
|
|
|
- NSMutableArray *searchList = [parser.searchList mutableCopy];
|
|
|
-
|
|
|
+
|
|
|
+ NCXMLListParser *parser = [NCXMLListParser new];
|
|
|
+ [parser initParserWithData:responseData controlFirstFileOfList:false];
|
|
|
+ NSMutableArray *list = [parser.list mutableCopy];
|
|
|
+
|
|
|
//Return success
|
|
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
- successRequest(response, searchList, request.redirectedServer, token);
|
|
|
+ successRequest(response, list, request.redirectedServer, token);
|
|
|
});
|
|
|
});
|
|
|
}
|
|
@@ -678,11 +554,11 @@
|
|
|
|
|
|
NSData *responseData = (NSData*) responseObject;
|
|
|
|
|
|
- OCXMLListParser *parser = [OCXMLListParser new];
|
|
|
- [parser initParserWithData:responseData];
|
|
|
- NSMutableArray *searchList = [parser.searchList mutableCopy];
|
|
|
+ NCXMLListParser *parser = [NCXMLListParser new];
|
|
|
+ [parser initParserWithData:responseData controlFirstFileOfList:false];
|
|
|
+ NSMutableArray *list = [parser.list mutableCopy];
|
|
|
|
|
|
- successRequest(response, searchList, request.redirectedServer, token);
|
|
|
+ successRequest(response, list, request.redirectedServer, token);
|
|
|
}
|
|
|
} failure:^(NSHTTPURLResponse *response, id responseData, NSError *error, NSString *token) {
|
|
|
failureRequest(response, error, token, request.redirectedServer);
|
|
@@ -738,12 +614,12 @@
|
|
|
|
|
|
NSData *responseData = (NSData*) responseObject;
|
|
|
|
|
|
- OCXMLListParser *parser = [OCXMLListParser new];
|
|
|
- [parser initParserWithData:responseData];
|
|
|
- NSMutableArray *searchList = [parser.searchList mutableCopy];
|
|
|
+ NCXMLListParser *parser = [NCXMLListParser new];
|
|
|
+ [parser initParserWithData:responseData controlFirstFileOfList:false];
|
|
|
+ NSMutableArray *list = [parser.list mutableCopy];
|
|
|
|
|
|
//Return success
|
|
|
- successRequest(response, searchList, request.redirectedServer, token);
|
|
|
+ successRequest(response, list, request.redirectedServer, token);
|
|
|
}
|
|
|
|
|
|
} failure:^(NSHTTPURLResponse *response, id responseData, NSError *error, NSString *token) {
|
|
@@ -752,6 +628,129 @@
|
|
|
}];
|
|
|
}
|
|
|
|
|
|
+///-----------------------------------
|
|
|
+/// @name Download File Session
|
|
|
+///-----------------------------------
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+- (NSURLSessionDownloadTask *) downloadFileSession:(NSString *)remotePath toDestiny:(NSString *)localPath defaultPriority:(BOOL)defaultPriority encode:(BOOL)encode onCommunication:(OCCommunication *)sharedOCCommunication progress:(void(^)(NSProgress *progress))downloadProgress successRequest:(void(^)(NSURLResponse *response, NSURL *filePath)) successRequest failureRequest:(void(^)(NSURLResponse *response, NSError *error)) failureRequest {
|
|
|
+
|
|
|
+ OCWebDAVClient *request = [OCWebDAVClient new];
|
|
|
+ request = [self getRequestWithCredentials:request];
|
|
|
+ if (encode) remotePath = [remotePath encodeString:NSUTF8StringEncoding];
|
|
|
+
|
|
|
+ NSURLSessionDownloadTask *downloadTask = [request downloadWithSessionPath:remotePath toPath:localPath defaultPriority:defaultPriority onCommunication:sharedOCCommunication progress:^(NSProgress *progress) {
|
|
|
+ downloadProgress(progress);
|
|
|
+ } success:^(NSURLResponse *response, NSURL *filePath) {
|
|
|
+
|
|
|
+ [UtilsFramework addCookiesToStorageFromResponse:(NSURLResponse *) response andPath:[NSURL URLWithString:remotePath]];
|
|
|
+ successRequest(response,filePath);
|
|
|
+
|
|
|
+ } failure:^(NSURLResponse *response, NSError *error) {
|
|
|
+ [UtilsFramework addCookiesToStorageFromResponse:(NSURLResponse *) response andPath:[NSURL URLWithString:remotePath]];
|
|
|
+ failureRequest(response,error);
|
|
|
+ }];
|
|
|
+
|
|
|
+ return downloadTask;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+///-----------------------------------
|
|
|
+/// @name Set Download Task Complete Block
|
|
|
+///-----------------------------------
|
|
|
+
|
|
|
+
|
|
|
+- (void)setDownloadTaskComleteBlock: (NSURL * (^)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, NSURL *location))block{
|
|
|
+
|
|
|
+ [self.downloadSessionManager setDownloadTaskDidFinishDownloadingBlock:block];
|
|
|
+
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+///-----------------------------------
|
|
|
+/// @name Set Download Task Did Get Body Data Block
|
|
|
+///-----------------------------------
|
|
|
+
|
|
|
+
|
|
|
+- (void) setDownloadTaskDidGetBodyDataBlock: (void(^)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, int64_t bytesWritten, int64_t totalBytesWritten, int64_t totalBytesExpectedToWrite)) block{
|
|
|
+
|
|
|
+ [self.downloadSessionManager setDownloadTaskDidWriteDataBlock:^(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, int64_t bytesWritten, int64_t totalBytesWritten, int64_t totalBytesExpectedToWrite) {
|
|
|
+ block(session,downloadTask,bytesWritten,totalBytesWritten,totalBytesExpectedToWrite);
|
|
|
+ }];
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+///-----------------------------------
|
|
|
+/// @name Upload File Session
|
|
|
+///-----------------------------------
|
|
|
+
|
|
|
+- (NSURLSessionUploadTask *) uploadFileSession:(NSString *) localPath toDestiny:(NSString *) remotePath onCommunication:(OCCommunication *)sharedOCCommunication progress:(void(^)(NSProgress *progress))uploadProgress successRequest:(void(^)(NSURLResponse *response, NSString *redirectedServer)) successRequest failureRequest:(void(^)(NSURLResponse *response, NSString *redirectedServer, NSError *error)) failureRequest failureBeforeRequest:(void(^)(NSError *error)) failureBeforeRequest {
|
|
|
+
|
|
|
+ OCWebDAVClient *request = [OCWebDAVClient new];
|
|
|
+ request = [self getRequestWithCredentials:request];
|
|
|
+
|
|
|
+
|
|
|
+ remotePath = [remotePath encodeString:NSUTF8StringEncoding];
|
|
|
+
|
|
|
+ NSURLSessionUploadTask *uploadTask = [request putWithSessionLocalPath:localPath atRemotePath:remotePath onCommunication:sharedOCCommunication progress:^(NSProgress *progress) {
|
|
|
+ uploadProgress(progress);
|
|
|
+ } success:^(NSURLResponse *response, id responseObjec){
|
|
|
+ [UtilsFramework addCookiesToStorageFromResponse:(NSURLResponse *) response andPath:[NSURL URLWithString:remotePath]];
|
|
|
+ //TODO: The second parameter is the redirected server
|
|
|
+ successRequest(response, @"");
|
|
|
+ } failure:^(NSURLResponse *response, id responseObject, NSError *error) {
|
|
|
+ [UtilsFramework addCookiesToStorageFromResponse:(NSURLResponse *) response andPath:[NSURL URLWithString:remotePath]];
|
|
|
+ //TODO: The second parameter is the redirected server
|
|
|
+
|
|
|
+ NSData *responseData = (NSData*) responseObject;
|
|
|
+
|
|
|
+ OCXMLServerErrorsParser *serverErrorParser = [OCXMLServerErrorsParser new];
|
|
|
+
|
|
|
+ [serverErrorParser startToParseWithData:responseData withCompleteBlock:^(NSError *err) {
|
|
|
+
|
|
|
+ if (err) {
|
|
|
+ failureRequest(response, @"", err);
|
|
|
+ }else{
|
|
|
+ failureRequest(response, @"", error);
|
|
|
+ }
|
|
|
+
|
|
|
+ }];
|
|
|
+
|
|
|
+ } failureBeforeRequest:^(NSError *error) {
|
|
|
+ failureBeforeRequest(error);
|
|
|
+ }];
|
|
|
+
|
|
|
+ return uploadTask;
|
|
|
+}
|
|
|
+
|
|
|
+///-----------------------------------
|
|
|
+/// @name Set Task Did Complete Block
|
|
|
+///-----------------------------------
|
|
|
+
|
|
|
+- (void) setTaskDidCompleteBlock: (void(^)(NSURLSession *session, NSURLSessionTask *task, NSError *error)) block{
|
|
|
+
|
|
|
+ [self.uploadSessionManager setTaskDidCompleteBlock:^(NSURLSession *session, NSURLSessionTask *task, NSError *error) {
|
|
|
+
|
|
|
+ block(session, task, error);
|
|
|
+ }];
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+///-----------------------------------
|
|
|
+/// @name Set Task Did Send Body Data Block
|
|
|
+///-----------------------------------
|
|
|
+
|
|
|
+
|
|
|
+- (void) setTaskDidSendBodyDataBlock: (void(^)(NSURLSession *session, NSURLSessionTask *task, int64_t bytesSent, int64_t totalBytesSent, int64_t totalBytesExpectedToSend)) block{
|
|
|
+
|
|
|
+ [self.uploadSessionManager setTaskDidSendBodyDataBlock:^(NSURLSession *session, NSURLSessionTask *task, int64_t bytesSent, int64_t totalBytesSent, int64_t totalBytesExpectedToSend) {
|
|
|
+ block(session, task, bytesSent, totalBytesSent, totalBytesExpectedToSend);
|
|
|
+ }];
|
|
|
+}
|
|
|
+
|
|
|
#pragma mark - OC/NC API Calls
|
|
|
|
|
|
- (NSString *) getCurrentServerVersion {
|
|
@@ -1238,42 +1237,6 @@
|
|
|
}];
|
|
|
}
|
|
|
|
|
|
-- (void)getSharePermissionsFile:(NSString *)fileName onCommunication:(OCCommunication *)sharedOCComunication successRequest:(void(^)(NSHTTPURLResponse *response, NSString *permissions, NSString *redirectedServer)) successRequest failureRequest:(void(^)(NSHTTPURLResponse *response, NSError *error, NSString *redirectedServer)) failureRequest{
|
|
|
-
|
|
|
- fileName = [fileName encodeString:NSUTF8StringEncoding];
|
|
|
-
|
|
|
- OCWebDAVClient *request = [OCWebDAVClient new];
|
|
|
- request = [self getRequestWithCredentials:request];
|
|
|
-
|
|
|
- [request getSharePermissionsFile:fileName onCommunication:sharedOCComunication success:^(NSHTTPURLResponse *response, id responseObject) {
|
|
|
-
|
|
|
- if (successRequest) {
|
|
|
-
|
|
|
- NSString *permissions;
|
|
|
- NSData *responseData = (NSData *)responseObject;
|
|
|
-
|
|
|
- NSString *newStr = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];
|
|
|
- NSLog(@"newStrReadFolder: %@", newStr);
|
|
|
-
|
|
|
- OCXMLParser *parser = [[OCXMLParser alloc]init];
|
|
|
- [parser initParserWithData:responseData];
|
|
|
- NSMutableArray *directoryList = [parser.directoryList mutableCopy];
|
|
|
-
|
|
|
- if ([directoryList count] == 1) {
|
|
|
- OCFileDto *file = [directoryList objectAtIndex:0];
|
|
|
- permissions = file.permissions;
|
|
|
- }
|
|
|
-
|
|
|
- //Return success
|
|
|
- successRequest(response, permissions, request.redirectedServer);
|
|
|
- }
|
|
|
-
|
|
|
- } failure:^(NSHTTPURLResponse *response, NSData *responseData, NSError *error) {
|
|
|
-
|
|
|
- failureRequest(response, error, request.redirectedServer);
|
|
|
- }];
|
|
|
-}
|
|
|
-
|
|
|
#pragma mark - Capabilities
|
|
|
|
|
|
- (void) getCapabilitiesOfServer:(NSString*)serverPath onCommunication:(OCCommunication *)sharedOCComunication successRequest:(void(^)(NSHTTPURLResponse *response, OCCapabilities *capabilities, NSString *redirectedServer)) successRequest failureRequest:(void(^)(NSHTTPURLResponse *response, NSError *error, NSString *redirectedServer)) failureRequest{
|
|
@@ -3083,9 +3046,9 @@
|
|
|
|
|
|
[request listTrash:path depth:depth onCommunication:sharedOCCommunication success:^(NSHTTPURLResponse *response, id responseObject) {
|
|
|
|
|
|
- OCXMLParser *parser = [OCXMLParser new];
|
|
|
- [parser initParserWithData:responseObject];
|
|
|
- NSMutableArray *list = [parser.directoryList mutableCopy];
|
|
|
+ NCXMLListParser *parser = [NCXMLListParser new];
|
|
|
+ [parser initParserWithData:responseObject controlFirstFileOfList:true];
|
|
|
+ NSMutableArray *list = [parser.list mutableCopy];
|
|
|
|
|
|
successRequest(response, list, request.redirectedServer);
|
|
|
|