CCMove.m 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549
  1. //
  2. // CCMove.m
  3. // Nextcloud iOS
  4. //
  5. // Created by Marino Faggiana on 04/09/14.
  6. // Copyright (c) 2017 TWS. All rights reserved.
  7. //
  8. // Author Marino Faggiana <m.faggiana@twsweb.it>
  9. //
  10. // This program is free software: you can redistribute it and/or modify
  11. // it under the terms of the GNU General Public License as published by
  12. // the Free Software Foundation, either version 3 of the License, or
  13. // (at your option) any later version.
  14. //
  15. // This program is distributed in the hope that it will be useful,
  16. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. // GNU General Public License for more details.
  19. //
  20. // You should have received a copy of the GNU General Public License
  21. // along with this program. If not, see <http://www.gnu.org/licenses/>.
  22. //
  23. #import "CCMove.h"
  24. #import "NCBridgeSwift.h"
  25. @interface CCMove ()
  26. {
  27. NSString *activeAccount;
  28. NSString *activePassword;
  29. NSString *activeUrl;
  30. NSString *activeUser;
  31. NSString *activeUserID;
  32. NSString *directoryUser;
  33. BOOL _loadingFolder;
  34. // Automatic Upload Folder
  35. NSString *_autoUploadFileName;
  36. NSString *_autoUploadDirectory;
  37. }
  38. @end
  39. @implementation CCMove
  40. // MARK: - View
  41. - (void)viewDidLoad
  42. {
  43. [super viewDidLoad];
  44. tableAccount *recordAccount = [[NCManageDatabase sharedInstance] getAccountActive];
  45. if (recordAccount) {
  46. activeAccount = recordAccount.account;
  47. activePassword = recordAccount.password;
  48. activeUrl = recordAccount.url;
  49. activeUser = recordAccount.user;
  50. activeUserID = recordAccount.userID;
  51. directoryUser = [CCUtility getDirectoryActiveUser:activeUser activeUrl:activeUrl];
  52. } else {
  53. UIAlertController * alert= [UIAlertController alertControllerWithTitle:nil message:NSLocalizedString(@"_no_active_account_", nil) preferredStyle:UIAlertControllerStyleAlert];
  54. UIAlertAction* ok = [UIAlertAction actionWithTitle:NSLocalizedString(@"_ok_", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
  55. [alert dismissViewControllerAnimated:YES completion:nil];
  56. }];
  57. [alert addAction:ok];
  58. [self presentViewController:alert animated:YES completion:nil];
  59. }
  60. [self.cancel setTitle:NSLocalizedString(@"_cancel_", nil)];
  61. [self.create setTitle:NSLocalizedString(@"_create_folder_", nil)];
  62. if (![_serverUrl length]) {
  63. UIImageView *image;
  64. _serverUrl = [CCUtility getHomeServerUrlActiveUrl:activeUrl];
  65. tableCapabilities *capabilities = [[NCManageDatabase sharedInstance] getCapabilites];
  66. if ([capabilities.themingColor isEqualToString:@"#FFFFFF"])
  67. image = [[UIImageView alloc] initWithImage:[CCGraphics changeThemingColorImage:[UIImage imageNamed:@"navigationLogo"] color:[UIColor blackColor]]];
  68. else
  69. image = [[UIImageView alloc] initWithImage:[CCGraphics changeThemingColorImage:[UIImage imageNamed:@"navigationLogo"] color:[UIColor whiteColor]]];
  70. [self.navigationController.navigationBar.topItem setTitleView:image];
  71. self.title = @"Home";
  72. } else {
  73. UILabel* label = [[UILabel alloc] initWithFrame:CGRectMake(0,0, self.navigationItem.titleView.frame.size.width, 40)];
  74. label.text = self.passMetadata.fileNameView;
  75. label.textColor = NCBrandColor.sharedInstance.brandText;
  76. label.backgroundColor =[UIColor clearColor];
  77. label.textAlignment = NSTextAlignmentCenter;
  78. self.navigationItem.titleView=label;
  79. }
  80. // TableView : at the end of rows nothing
  81. self.tableView.tableFooterView = [UIView new];
  82. self.tableView.separatorColor = NCBrandColor.sharedInstance.seperator;
  83. self.tableView.emptyDataSetDelegate = self;
  84. self.tableView.emptyDataSetSource = self;
  85. // get auto upload folder
  86. _autoUploadFileName = [[NCManageDatabase sharedInstance] getAccountAutoUploadFileName];
  87. _autoUploadDirectory = [[NCManageDatabase sharedInstance] getAccountAutoUploadDirectory:activeUrl];
  88. // read file->folder
  89. [self readFileReloadFolder];
  90. }
  91. // Apparirà
  92. - (void)viewWillAppear:(BOOL)animated
  93. {
  94. [super viewWillAppear:animated];
  95. self.navigationController.navigationBar.barTintColor = NCBrandColor.sharedInstance.brand;
  96. self.navigationController.navigationBar.tintColor = NCBrandColor.sharedInstance.brandText;
  97. self.navigationController.toolbar.barTintColor = NCBrandColor.sharedInstance.tabBar;
  98. self.navigationController.toolbar.tintColor = NCBrandColor.sharedInstance.brandElement;
  99. if (self.hideCreateFolder) {
  100. [self.create setEnabled:NO];
  101. [self.create setTintColor: [UIColor clearColor]];
  102. }
  103. }
  104. #pragma --------------------------------------------------------------------------------------------
  105. #pragma mark ==== DZNEmptyDataSetSource ====
  106. #pragma --------------------------------------------------------------------------------------------
  107. - (BOOL)emptyDataSetShouldDisplay:(UIScrollView *)scrollView
  108. {
  109. if (_loadingFolder)
  110. return YES;
  111. else
  112. return NO;
  113. }
  114. - (BOOL)emptyDataSetShouldAllowScroll:(UIScrollView *)scrollView
  115. {
  116. return NO;
  117. }
  118. - (UIColor *)backgroundColorForEmptyDataSet:(UIScrollView *)scrollView
  119. {
  120. return [UIColor whiteColor];
  121. }
  122. - (UIView *)customViewForEmptyDataSet:(UIScrollView *)scrollView
  123. {
  124. if (_loadingFolder) {
  125. UIActivityIndicatorView *activityView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
  126. activityView.transform = CGAffineTransformMakeScale(1.5f, 1.5f);
  127. activityView.color = [NCBrandColor sharedInstance].brandElement;
  128. [activityView startAnimating];
  129. return activityView;
  130. }
  131. return nil;
  132. }
  133. // MARK: - IBAction
  134. - (IBAction)cancel:(UIBarButtonItem *)sender
  135. {
  136. if ([self.delegate respondsToSelector:@selector(dismissMove)])
  137. [self.delegate dismissMove];
  138. [self dismissViewControllerAnimated:YES completion:nil];
  139. }
  140. - (IBAction)move:(UIBarButtonItem *)sender
  141. {
  142. [_networkingOperationQueue cancelAllOperations];
  143. if ([self.delegate respondsToSelector:@selector(dismissMove)])
  144. [self.delegate dismissMove];
  145. [self.delegate moveServerUrlTo:_serverUrl title:self.passMetadata.fileNameView];
  146. [self dismissViewControllerAnimated:YES completion:nil];
  147. }
  148. - (IBAction)create:(UIBarButtonItem *)sender
  149. {
  150. UIAlertController *alertController = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"_create_folder_",nil) message:@"" preferredStyle:UIAlertControllerStyleAlert];
  151. [alertController addTextFieldWithConfigurationHandler:^(UITextField *textField) {
  152. //textField.placeholder = NSLocalizedString(@"LoginPlaceholder", @"Login");
  153. textField.autocapitalizationType = UITextAutocapitalizationTypeWords;
  154. }];
  155. [alertController addAction: [UIAlertAction actionWithTitle:NSLocalizedString(@"_save_", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
  156. [self createFolder:alertController.textFields.firstObject.text];
  157. }]];
  158. [alertController addAction: [UIAlertAction actionWithTitle:NSLocalizedString(@"_cancel_", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
  159. }]];
  160. [self presentViewController:alertController animated:YES completion:nil];
  161. }
  162. // MARK: - BKPasscodeViewController
  163. - (void)passcodeViewController:(CCBKPasscode *)aViewController didFinishWithPasscode:(NSString *)aPasscode
  164. {
  165. [aViewController dismissViewControllerAnimated:YES completion:nil];
  166. [self performSegueDirectoryWithControlPasscode:false];
  167. }
  168. - (void)passcodeViewController:(BKPasscodeViewController *)aViewController authenticatePasscode:(NSString *)aPasscode resultHandler:(void (^)(BOOL))aResultHandler
  169. {
  170. if ([aPasscode isEqualToString:[CCUtility getBlockCode]]) {
  171. self.lockUntilDate = nil;
  172. self.failedAttempts = 0;
  173. aResultHandler(YES);
  174. } else {
  175. aResultHandler(NO);
  176. }
  177. }
  178. - (void)passcodeViewControllerDidFailAttempt:(BKPasscodeViewController *)aViewController
  179. {
  180. self.failedAttempts++;
  181. if (self.failedAttempts > 5) {
  182. NSTimeInterval timeInterval = 60;
  183. if (self.failedAttempts > 6) {
  184. NSUInteger multiplier = self.failedAttempts - 6;
  185. timeInterval = (5 * 60) * multiplier;
  186. if (timeInterval > 3600 * 24) {
  187. timeInterval = 3600 * 24;
  188. }
  189. }
  190. self.lockUntilDate = [NSDate dateWithTimeIntervalSinceNow:timeInterval];
  191. }
  192. }
  193. - (NSUInteger)passcodeViewControllerNumberOfFailedAttempts:(BKPasscodeViewController *)aViewController
  194. {
  195. return self.failedAttempts;
  196. }
  197. - (NSDate *)passcodeViewControllerLockUntilDate:(BKPasscodeViewController *)aViewController
  198. {
  199. return self.lockUntilDate;
  200. }
  201. - (void)passcodeViewCloseButtonPressed:(id)sender
  202. {
  203. [self dismissViewControllerAnimated:YES completion:nil];
  204. }
  205. // MARK: - NetWorking
  206. - (void)addNetworkingQueue:(CCMetadataNet *)metadataNet
  207. {
  208. OCnetworking *operation = [[OCnetworking alloc] initWithDelegate:self metadataNet:metadataNet withUser:activeUser withUserID:activeUserID withPassword:activePassword withUrl:activeUrl];
  209. _networkingOperationQueue.maxConcurrentOperationCount = k_maxConcurrentOperation;
  210. [_networkingOperationQueue addOperation:operation];
  211. }
  212. // MARK: - Read File
  213. - (void)readFileSuccessFailure:(CCMetadataNet *)metadataNet metadata:(tableMetadata *)metadata message:(NSString *)message errorCode:(NSInteger)errorCode
  214. {
  215. if (errorCode == 0) {
  216. if ([metadataNet.selector isEqualToString:selectorReadFileReloadFolder]) {
  217. tableDirectory *directory = [[NCManageDatabase sharedInstance] getTableDirectoryWithPredicate:[NSPredicate predicateWithFormat:@"account == %@ AND serverUrl == %@", metadataNet.account, metadataNet.serverUrl]];
  218. if ([metadata.etag isEqualToString:directory.etag] == NO) {
  219. [self readFolder];
  220. }
  221. }
  222. } else {
  223. [self readFolder];
  224. }
  225. }
  226. - (void)readFileReloadFolder
  227. {
  228. CCMetadataNet *metadataNet = [[CCMetadataNet alloc] initWithAccount:activeAccount];
  229. metadataNet.action = actionReadFile;
  230. metadataNet.priority = NSOperationQueuePriorityHigh;
  231. metadataNet.selector = selectorReadFileReloadFolder;
  232. metadataNet.serverUrl = _serverUrl;
  233. [self addNetworkingQueue:metadataNet];
  234. }
  235. // MARK: - Read Folder
  236. - (void)readFolderSuccessFailure:(CCMetadataNet *)metadataNet metadataFolder:(tableMetadata *)metadataFolder metadatas:(NSArray *)metadatas message:(NSString *)message errorCode:(NSInteger)errorCode
  237. {
  238. if (errorCode == 0) {
  239. NSMutableArray *metadatasToInsertInDB = [NSMutableArray new];
  240. // Update directory etag
  241. [[NCManageDatabase sharedInstance] setDirectoryWithServerUrl:metadataNet.serverUrl serverUrlTo:nil etag:metadataFolder.etag fileID:metadataFolder.fileID encrypted:metadataFolder.e2eEncrypted];
  242. for (tableMetadata *metadata in metadatas) {
  243. // Create directory FS
  244. if ([[NSFileManager defaultManager] fileExistsAtPath:[NSString stringWithFormat:@"%@/%@", [CCUtility getDirectoryProviderStorage], metadata.fileID]] == NO)
  245. [[NSFileManager defaultManager] createDirectoryAtPath:[NSString stringWithFormat:@"%@/%@", [CCUtility getDirectoryProviderStorage], metadata.fileID] withIntermediateDirectories:YES attributes:nil error:nil];
  246. // Insert in Array
  247. [metadatasToInsertInDB addObject:metadata];
  248. }
  249. // insert in Database
  250. metadatas = [[NCManageDatabase sharedInstance] addMetadatas:metadatasToInsertInDB serverUrl:metadataNet.serverUrl];
  251. _loadingFolder = NO;
  252. [self.tableView reloadData];
  253. } else {
  254. _loadingFolder = NO;
  255. self.move.enabled = NO;
  256. [self.tableView reloadData];
  257. UIAlertController *alertController = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"_error_",nil) message:message preferredStyle:UIAlertControllerStyleAlert];
  258. [alertController addAction: [UIAlertAction actionWithTitle:NSLocalizedString(@"_ok_", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
  259. }]];
  260. [self presentViewController:alertController animated:YES completion:nil];
  261. }
  262. }
  263. - (void)readFolder
  264. {
  265. CCMetadataNet *metadataNet = [[CCMetadataNet alloc] initWithAccount:activeAccount];
  266. metadataNet.action = actionReadFolder;
  267. metadataNet.date = nil;
  268. metadataNet.depth = @"1";
  269. metadataNet.selector = selectorReadFolder;
  270. metadataNet.serverUrl = _serverUrl;
  271. [self addNetworkingQueue:metadataNet];
  272. //
  273. _loadingFolder = YES;
  274. [self.tableView reloadData];
  275. }
  276. // MARK: - Create Folder
  277. - (void)createFolderSuccessFailure:(CCMetadataNet *)metadataNet message:(NSString *)message errorCode:(NSInteger)errorCode
  278. {
  279. if (errorCode == 0) {
  280. [self readFolder];
  281. } else {
  282. UIAlertController *alertController = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"_error_",nil) message:message preferredStyle:UIAlertControllerStyleAlert];
  283. [alertController addAction: [UIAlertAction actionWithTitle:NSLocalizedString(@"_ok_", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
  284. }]];
  285. [self presentViewController:alertController animated:YES completion:nil];
  286. }
  287. }
  288. - (void)createFolder:(NSString *)fileNameFolder
  289. {
  290. CCMetadataNet *metadataNet = [[CCMetadataNet alloc] initWithAccount:activeAccount];
  291. fileNameFolder = [CCUtility removeForbiddenCharactersServer:fileNameFolder];
  292. if (![fileNameFolder length]) return;
  293. metadataNet.action = actionCreateFolder;
  294. metadataNet.fileName = fileNameFolder;
  295. metadataNet.selector = selectorCreateFolder;
  296. metadataNet.selectorPost = selectorReadFolderForced;
  297. metadataNet.serverUrl = _serverUrl;
  298. [self addNetworkingQueue:metadataNet];
  299. }
  300. // MARK: - Table
  301. - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
  302. {
  303. return 1;
  304. }
  305. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
  306. {
  307. NSString *directoryID = [[NCManageDatabase sharedInstance] getDirectoryID:_serverUrl];
  308. if (!directoryID) return 0;
  309. NSPredicate *predicate;
  310. if (self.includeDirectoryE2EEncryption) predicate = [NSPredicate predicateWithFormat:@"account == %@ AND directoryID == %@ AND directory == true", activeAccount, directoryID];
  311. else predicate = [NSPredicate predicateWithFormat:@"account == %@ AND directoryID == %@ AND directory == true AND e2eEncrypted == false", activeAccount, directoryID];
  312. NSArray *result = [[NCManageDatabase sharedInstance] getMetadatasWithPredicate:predicate sorted:nil ascending:NO];
  313. if (result)
  314. return [result count];
  315. else
  316. return 0;
  317. }
  318. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  319. {
  320. NSPredicate *predicate;
  321. static NSString *CellIdentifier = @"MyCustomCell";
  322. UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
  323. if (cell == nil) {
  324. cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
  325. }
  326. NSString *directoryID = [[NCManageDatabase sharedInstance] getDirectoryID:_serverUrl];
  327. if (!directoryID)
  328. return cell;
  329. if (self.includeDirectoryE2EEncryption) predicate = [NSPredicate predicateWithFormat:@"account == %@ AND directoryID == %@ AND directory == true", activeAccount, directoryID];
  330. else predicate = [NSPredicate predicateWithFormat:@"account == %@ AND directoryID == %@ AND directory == true AND e2eEncrypted == false", activeAccount, directoryID];
  331. tableMetadata *metadata = [[NCManageDatabase sharedInstance] getMetadataAtIndexWithPredicate:predicate sorted:@"fileName" ascending:YES index:indexPath.row];
  332. // colors
  333. cell.textLabel.textColor = [UIColor blackColor];
  334. cell.detailTextLabel.text = @"";
  335. if (metadata.e2eEncrypted)
  336. cell.imageView.image = [CCGraphics changeThemingColorImage:[UIImage imageNamed:@"folderEncrypted"] color:[NCBrandColor sharedInstance].brandElement];
  337. else if ([metadata.fileName isEqualToString:_autoUploadFileName] && [self.serverUrl isEqualToString:_autoUploadDirectory])
  338. cell.imageView.image = [CCGraphics changeThemingColorImage:[UIImage imageNamed:@"folderPhotos"] color:[NCBrandColor sharedInstance].brandElement];
  339. else
  340. cell.imageView.image = [CCGraphics changeThemingColorImage:[UIImage imageNamed:@"folder"] color:[NCBrandColor sharedInstance].brandElement];
  341. cell.textLabel.text = metadata.fileNameView;
  342. return cell;
  343. }
  344. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
  345. {
  346. [self performSegueDirectoryWithControlPasscode:YES];
  347. }
  348. // MARK: - Navigation
  349. - (void)performSegueDirectoryWithControlPasscode:(BOOL)controlPasscode
  350. {
  351. NSString *nomeDir;
  352. NSPredicate *predicate;
  353. NSIndexPath *index = [self.tableView indexPathForSelectedRow];
  354. NSString *directoryID = [[NCManageDatabase sharedInstance] getDirectoryID:_serverUrl];
  355. if (!directoryID) return;
  356. if (self.includeDirectoryE2EEncryption) predicate = [NSPredicate predicateWithFormat:@"account == %@ AND directoryID == %@ AND directory == true", activeAccount, directoryID];
  357. else predicate = [NSPredicate predicateWithFormat:@"account == %@ AND directoryID == %@ AND directory == true AND e2eEncrypted == false", activeAccount, directoryID];
  358. tableMetadata *metadata = [[NCManageDatabase sharedInstance] getMetadataAtIndexWithPredicate:predicate sorted:@"fileName" ascending:YES index:index.row];
  359. // lockServerUrl
  360. NSString *lockServerUrl = [CCUtility stringAppendServerUrl:_serverUrl addFileName:metadata.fileName];
  361. // Se siamo in presenza di una directory bloccata E è attivo il block E la sessione PASSWORD Lock è senza data ALLORA chiediamo la password per procedere
  362. tableDirectory *directory = [[NCManageDatabase sharedInstance] getTableDirectoryWithPredicate:[NSPredicate predicateWithFormat:@"account == %@ AND serverUrl == %@", activeAccount, lockServerUrl]];
  363. if (directory.lock && [[CCUtility getBlockCode] length] && controlPasscode) {
  364. CCBKPasscode *viewController = [[CCBKPasscode alloc] initWithNibName:nil bundle:nil];
  365. viewController.delegate = self;
  366. //viewController.fromType = CCBKPasscodeFromLockDirectory;
  367. viewController.type = BKPasscodeViewControllerCheckPasscodeType;
  368. viewController.inputViewTitlePassword = YES;
  369. if ([CCUtility getSimplyBlockCode]) {
  370. viewController.passcodeStyle = BKPasscodeInputViewNumericPasscodeStyle;
  371. viewController.passcodeInputView.maximumLength = 6;
  372. } else {
  373. viewController.passcodeStyle = BKPasscodeInputViewNormalPasscodeStyle;
  374. viewController.passcodeInputView.maximumLength = 64;
  375. }
  376. BKTouchIDManager *touchIDManager = [[BKTouchIDManager alloc] initWithKeychainServiceName:k_serviceShareKeyChain];
  377. touchIDManager.promptText = NSLocalizedString(@"_scan_fingerprint_", nil);
  378. viewController.touchIDManager = touchIDManager;
  379. viewController.title = NSLocalizedString(@"_folder_blocked_", nil);
  380. viewController.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(passcodeViewCloseButtonPressed:)];
  381. viewController.navigationItem.leftBarButtonItem.tintColor = [UIColor blackColor];
  382. UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:viewController];
  383. [self presentViewController:navController animated:YES completion:nil];
  384. return;
  385. }
  386. nomeDir = metadata.fileName;
  387. CCMove *viewController = [[UIStoryboard storyboardWithName:@"CCMove" bundle:nil] instantiateViewControllerWithIdentifier:@"CCMoveVC"];
  388. viewController.delegate = self.delegate;
  389. viewController.includeDirectoryE2EEncryption = self.includeDirectoryE2EEncryption;
  390. viewController.move.title = self.move.title;
  391. viewController.hideCreateFolder = self.hideCreateFolder;
  392. viewController.networkingOperationQueue = _networkingOperationQueue;
  393. viewController.passMetadata = metadata;
  394. viewController.serverUrl = [CCUtility stringAppendServerUrl:_serverUrl addFileName:nomeDir];
  395. [self.navigationController pushViewController:viewController animated:YES];
  396. }
  397. @end