|
@@ -89,10 +89,12 @@
|
|
|
return returnError;
|
|
|
}
|
|
|
|
|
|
-- (NSError *)readFile:(NSString *)filePathName user:(NSString *)user userID:(NSString *)userID password:(NSString *)password
|
|
|
+- (NSError *)readFile:(NSString *)filePathName user:(NSString *)user userID:(NSString *)userID password:(NSString *)password items:(NSArray **)items
|
|
|
{
|
|
|
OCCommunication *communication = [CCNetworking sharedNetworking].sharedOCCommunication;
|
|
|
+
|
|
|
__block NSError *returnError = nil;
|
|
|
+ __block NSArray *returnItems = nil;
|
|
|
|
|
|
dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
|
|
|
|
|
@@ -101,6 +103,7 @@
|
|
|
|
|
|
[communication readFile:filePathName onCommunication:communication successRequest:^(NSHTTPURLResponse *response, NSArray *items, NSString *redirectedServer) {
|
|
|
|
|
|
+ returnItems = items;
|
|
|
dispatch_semaphore_signal(semaphore);
|
|
|
|
|
|
} failureRequest:^(NSHTTPURLResponse *response, NSError *error, NSString *redirectedServer) {
|
|
@@ -112,6 +115,7 @@
|
|
|
while (dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER))
|
|
|
[[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:k_timeout_webdav]];
|
|
|
|
|
|
+ *items = returnItems;
|
|
|
return returnError;
|
|
|
}
|
|
|
|