CCMove.m 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534
  1. //
  2. // CCMove.m
  3. // Nextcloud iOS
  4. //
  5. // Created by Marino Faggiana on 04/09/14.
  6. // Copyright (c) 2017 Marino Faggiana. All rights reserved.
  7. //
  8. // Author Marino Faggiana <marino.faggiana@nextcloud.com>
  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. BOOL _loadingFolder;
  33. // Automatic Upload Folder
  34. NSString *_autoUploadFileName;
  35. NSString *_autoUploadDirectory;
  36. NSPredicate *predicateDataSource;
  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. } else {
  52. UIAlertController * alert= [UIAlertController alertControllerWithTitle:nil message:NSLocalizedString(@"_no_active_account_", nil) preferredStyle:UIAlertControllerStyleAlert];
  53. UIAlertAction* ok = [UIAlertAction actionWithTitle:NSLocalizedString(@"_ok_", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
  54. [alert dismissViewControllerAnimated:YES completion:nil];
  55. }];
  56. [alert addAction:ok];
  57. [self presentViewController:alert animated:YES completion:nil];
  58. }
  59. [self.cancel setTitle:NSLocalizedString(@"_cancel_", nil)];
  60. [self.create setTitle:NSLocalizedString(@"_create_folder_", nil)];
  61. if (![_serverUrl length]) {
  62. UIImageView *image;
  63. _serverUrl = [CCUtility getHomeServerUrlActiveUrl:activeUrl];
  64. tableCapabilities *capabilities = [[NCManageDatabase sharedInstance] getCapabilitesWithAccount:activeAccount];
  65. if ([capabilities.themingColor isEqualToString:@"#FFFFFF"])
  66. image = [[UIImageView alloc] initWithImage:[CCGraphics changeThemingColorImage:[UIImage imageNamed:@"themingLogo"] multiplier:2 color:[UIColor blackColor]]];
  67. else
  68. image = [[UIImageView alloc] initWithImage:[CCGraphics changeThemingColorImage:[UIImage imageNamed:@"themingLogo"] multiplier:2 color:[UIColor whiteColor]]];
  69. [self.navigationController.navigationBar.topItem setTitleView:image];
  70. self.title = @"Home";
  71. } else {
  72. UILabel* label = [[UILabel alloc] initWithFrame:CGRectMake(0,0, self.navigationItem.titleView.frame.size.width, 40)];
  73. label.text = self.passMetadata.fileNameView;
  74. label.textColor = NCBrandColor.sharedInstance.brandText;
  75. label.backgroundColor =[UIColor clearColor];
  76. label.textAlignment = NSTextAlignmentCenter;
  77. self.navigationItem.titleView=label;
  78. }
  79. // TableView : at the end of rows nothing
  80. self.tableView.tableFooterView = [UIView new];
  81. self.tableView.separatorColor = NCBrandColor.sharedInstance.seperator;
  82. self.tableView.emptyDataSetDelegate = self;
  83. self.tableView.emptyDataSetSource = self;
  84. // get auto upload folder
  85. _autoUploadFileName = [[NCManageDatabase sharedInstance] getAccountAutoUploadFileName];
  86. _autoUploadDirectory = [[NCManageDatabase sharedInstance] getAccountAutoUploadDirectory:activeUrl];
  87. // read file->folder
  88. [self readFile];
  89. }
  90. // Apparirà
  91. - (void)viewWillAppear:(BOOL)animated
  92. {
  93. [super viewWillAppear:animated];
  94. self.navigationController.navigationBar.barTintColor = NCBrandColor.sharedInstance.brand;
  95. self.navigationController.navigationBar.tintColor = NCBrandColor.sharedInstance.brandText;
  96. self.navigationController.toolbar.barTintColor = NCBrandColor.sharedInstance.tabBar;
  97. self.navigationController.toolbar.tintColor = NCBrandColor.sharedInstance.brandElement;
  98. if (self.hideCreateFolder) {
  99. [self.create setEnabled:NO];
  100. [self.create setTintColor: [UIColor clearColor]];
  101. }
  102. if (self.hideMoveutton) {
  103. [self.move setEnabled:NO];
  104. [self.move setTintColor: [UIColor clearColor]];
  105. }
  106. }
  107. #pragma --------------------------------------------------------------------------------------------
  108. #pragma mark ==== DZNEmptyDataSetSource ====
  109. #pragma --------------------------------------------------------------------------------------------
  110. - (BOOL)emptyDataSetShouldDisplay:(UIScrollView *)scrollView
  111. {
  112. if (_loadingFolder)
  113. return YES;
  114. else
  115. return NO;
  116. }
  117. - (BOOL)emptyDataSetShouldAllowScroll:(UIScrollView *)scrollView
  118. {
  119. return NO;
  120. }
  121. - (UIColor *)backgroundColorForEmptyDataSet:(UIScrollView *)scrollView
  122. {
  123. return [UIColor whiteColor];
  124. }
  125. - (UIView *)customViewForEmptyDataSet:(UIScrollView *)scrollView
  126. {
  127. if (_loadingFolder) {
  128. UIActivityIndicatorView *activityView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
  129. activityView.transform = CGAffineTransformMakeScale(1.5f, 1.5f);
  130. activityView.color = [NCBrandColor sharedInstance].brandElement;
  131. [activityView startAnimating];
  132. return activityView;
  133. }
  134. return nil;
  135. }
  136. // MARK: - IBAction
  137. - (IBAction)cancel:(UIBarButtonItem *)sender
  138. {
  139. if ([self.delegate respondsToSelector:@selector(dismissMove)])
  140. [self.delegate dismissMove];
  141. [self dismissViewControllerAnimated:YES completion:nil];
  142. }
  143. - (IBAction)move:(UIBarButtonItem *)sender
  144. {
  145. [_networkingOperationQueue cancelAllOperations];
  146. if ([self.delegate respondsToSelector:@selector(dismissMove)])
  147. [self.delegate dismissMove];
  148. [self.delegate moveServerUrlTo:_serverUrl title:self.passMetadata.fileNameView type:self.type];
  149. [self dismissViewControllerAnimated:YES completion:nil];
  150. }
  151. - (IBAction)create:(UIBarButtonItem *)sender
  152. {
  153. UIAlertController *alertController = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"_create_folder_",nil) message:@"" preferredStyle:UIAlertControllerStyleAlert];
  154. [alertController addTextFieldWithConfigurationHandler:^(UITextField *textField) {
  155. //textField.placeholder = NSLocalizedString(@"LoginPlaceholder", @"Login");
  156. textField.autocapitalizationType = UITextAutocapitalizationTypeWords;
  157. }];
  158. [alertController addAction: [UIAlertAction actionWithTitle:NSLocalizedString(@"_save_", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
  159. [self createFolder:alertController.textFields.firstObject.text];
  160. }]];
  161. [alertController addAction: [UIAlertAction actionWithTitle:NSLocalizedString(@"_cancel_", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
  162. }]];
  163. [self presentViewController:alertController animated:YES completion:nil];
  164. }
  165. // MARK: - BKPasscodeViewController
  166. - (void)passcodeViewController:(CCBKPasscode *)aViewController didFinishWithPasscode:(NSString *)aPasscode
  167. {
  168. [aViewController dismissViewControllerAnimated:YES completion:nil];
  169. [self performSegueDirectoryWithControlPasscode:false];
  170. }
  171. - (void)passcodeViewController:(BKPasscodeViewController *)aViewController authenticatePasscode:(NSString *)aPasscode resultHandler:(void (^)(BOOL))aResultHandler
  172. {
  173. if ([aPasscode isEqualToString:[CCUtility getBlockCode]]) {
  174. self.lockUntilDate = nil;
  175. self.failedAttempts = 0;
  176. aResultHandler(YES);
  177. } else {
  178. aResultHandler(NO);
  179. }
  180. }
  181. - (void)passcodeViewControllerDidFailAttempt:(BKPasscodeViewController *)aViewController
  182. {
  183. self.failedAttempts++;
  184. if (self.failedAttempts > 5) {
  185. NSTimeInterval timeInterval = 60;
  186. if (self.failedAttempts > 6) {
  187. NSUInteger multiplier = self.failedAttempts - 6;
  188. timeInterval = (5 * 60) * multiplier;
  189. if (timeInterval > 3600 * 24) {
  190. timeInterval = 3600 * 24;
  191. }
  192. }
  193. self.lockUntilDate = [NSDate dateWithTimeIntervalSinceNow:timeInterval];
  194. }
  195. }
  196. - (NSUInteger)passcodeViewControllerNumberOfFailedAttempts:(BKPasscodeViewController *)aViewController
  197. {
  198. return self.failedAttempts;
  199. }
  200. - (NSDate *)passcodeViewControllerLockUntilDate:(BKPasscodeViewController *)aViewController
  201. {
  202. return self.lockUntilDate;
  203. }
  204. - (void)passcodeViewCloseButtonPressed:(id)sender
  205. {
  206. [self dismissViewControllerAnimated:YES completion:nil];
  207. }
  208. // MARK: - Read File
  209. - (void)readFile
  210. {
  211. OCnetworking *ocNetworking = [[OCnetworking alloc] initWithDelegate:nil metadataNet:nil withUser:nil withUserID:nil withPassword:nil withUrl:nil];
  212. [ocNetworking readFile:nil serverUrl:_serverUrl account:activeAccount success:^(NSString *account, tableMetadata *metadata) {
  213. tableDirectory *directory = [[NCManageDatabase sharedInstance] getTableDirectoryWithPredicate:[NSPredicate predicateWithFormat:@"account == %@ AND serverUrl == %@", account, _serverUrl]];
  214. if ([metadata.etag isEqualToString:directory.etag] == NO) {
  215. [self readFolder];
  216. }
  217. } failure:^(NSString *account, NSString *message, NSInteger errorCode) {
  218. [self readFolder];
  219. }];
  220. }
  221. // MARK: - Read Folder
  222. - (void)readFolder
  223. {
  224. OCnetworking *ocNetworking = [[OCnetworking alloc] initWithDelegate:nil metadataNet:nil withUser:nil withUserID:nil withPassword:nil withUrl:nil];
  225. [ocNetworking readFolderWithAccount:activeAccount serverUrl:_serverUrl depth:@"1" completion:^(NSString *account, NSArray *metadatas, tableMetadata *metadataFolder, NSString *message, NSInteger errorCode) {
  226. if (errorCode == 0 && [account isEqualToString:activeAccount]) {
  227. // Update directory etag
  228. [[NCManageDatabase sharedInstance] setDirectoryWithServerUrl:_serverUrl serverUrlTo:nil etag:metadataFolder.etag fileID:metadataFolder.fileID encrypted:metadataFolder.e2eEncrypted account:activeAccount];
  229. [[NCManageDatabase sharedInstance] deleteMetadataWithPredicate:[NSPredicate predicateWithFormat:@"account == %@ AND serverUrl == %@ AND (status == %d OR status == %d)", activeAccount, _serverUrl, k_metadataStatusNormal, k_metadataStatusHide]];
  230. [[NCManageDatabase sharedInstance] setDateReadDirectoryWithServerUrl:_serverUrl account:activeAccount];
  231. NSArray *metadatasInDownload = [[NCManageDatabase sharedInstance] getMetadatasWithPredicate:[NSPredicate predicateWithFormat:@"account == %@ AND serverUrl == %@ AND (status == %d OR status == %d OR status == %d OR status == %d)", activeAccount, _serverUrl, k_metadataStatusWaitDownload, k_metadataStatusInDownload, k_metadataStatusDownloading, k_metadataStatusDownloadError] sorted:nil ascending:NO];
  232. // insert in Database
  233. (void)[[NCManageDatabase sharedInstance] addMetadatas:metadatas];
  234. // reinsert metadatas in Download
  235. if (metadatasInDownload) {
  236. (void)[[NCManageDatabase sharedInstance] addMetadatas:metadatasInDownload];
  237. }
  238. } else if (errorCode != 0) {
  239. self.move.enabled = NO;
  240. UIAlertController *alertController = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"_error_",nil) message:message preferredStyle:UIAlertControllerStyleAlert];
  241. [alertController addAction: [UIAlertAction actionWithTitle:NSLocalizedString(@"_ok_", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
  242. }]];
  243. [self presentViewController:alertController animated:YES completion:nil];
  244. }
  245. _loadingFolder = NO;
  246. [self.tableView reloadData];
  247. }];
  248. _loadingFolder = YES;
  249. [self.tableView reloadData];
  250. }
  251. // MARK: - Create Folder
  252. - (void)createFolder:(NSString *)fileNameFolder
  253. {
  254. OCnetworking *ocNetworking = [[OCnetworking alloc] initWithDelegate:nil metadataNet:nil withUser:nil withUserID:nil withPassword:nil withUrl:nil];
  255. [ocNetworking createFolder:fileNameFolder serverUrl:_serverUrl account:activeAccount success:^(NSString *account, NSString *fileID, NSDate *date) {
  256. [self readFolder];
  257. } failure:^(NSString *account, NSString *message, NSInteger errorCode) {
  258. UIAlertController *alertController = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"_error_",nil) message:message preferredStyle:UIAlertControllerStyleAlert];
  259. [alertController addAction: [UIAlertAction actionWithTitle:NSLocalizedString(@"_ok_", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
  260. }]];
  261. [self presentViewController:alertController animated:YES completion:nil];
  262. }];
  263. }
  264. // MARK: - Table
  265. - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
  266. {
  267. return 1;
  268. }
  269. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
  270. {
  271. if (self.includeDirectoryE2EEncryption) {
  272. if (self.includeImages) {
  273. predicateDataSource = [NSPredicate predicateWithFormat:@"account == %@ AND serverUrl == %@ AND (directory == true OR typeFile == 'image')", activeAccount, _serverUrl];
  274. } else {
  275. predicateDataSource = [NSPredicate predicateWithFormat:@"account == %@ AND serverUrl == %@ AND directory == true", activeAccount, _serverUrl];
  276. }
  277. } else {
  278. if (self.includeImages) {
  279. predicateDataSource = [NSPredicate predicateWithFormat:@"account == %@ AND serverUrl == %@ AND e2eEncrypted == false AND (directory == true OR typeFile == 'image')", activeAccount, _serverUrl];
  280. } else {
  281. predicateDataSource = [NSPredicate predicateWithFormat:@"account == %@ AND serverUrl == %@ AND e2eEncrypted == false AND directory == true", activeAccount, _serverUrl];
  282. }
  283. }
  284. NSArray *result = [[NCManageDatabase sharedInstance] getMetadatasWithPredicate:predicateDataSource sorted:nil ascending:NO];
  285. if (result)
  286. return [result count];
  287. else
  288. return 0;
  289. }
  290. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  291. {
  292. static NSString *CellIdentifier = @"MyCustomCell";
  293. UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
  294. if (cell == nil) {
  295. cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
  296. }
  297. tableMetadata *metadata = [[NCManageDatabase sharedInstance] getMetadataAtIndexWithPredicate:predicateDataSource sorted:@"fileName" ascending:YES index:indexPath.row];
  298. // Create Directory Provider Storage FileID
  299. [CCUtility getDirectoryProviderStorageFileID:metadata.fileID];
  300. // colors
  301. cell.textLabel.textColor = [UIColor blackColor];
  302. cell.detailTextLabel.text = @"";
  303. if (metadata.directory) {
  304. if (metadata.e2eEncrypted)
  305. cell.imageView.image = [CCGraphics changeThemingColorImage:[UIImage imageNamed:@"folderEncrypted"] multiplier:2 color:[NCBrandColor sharedInstance].brandElement];
  306. else if ([metadata.fileName isEqualToString:_autoUploadFileName] && [self.serverUrl isEqualToString:_autoUploadDirectory])
  307. cell.imageView.image = [CCGraphics changeThemingColorImage:[UIImage imageNamed:@"folderAutomaticUpload"] multiplier:2 color:[NCBrandColor sharedInstance].brandElement];
  308. else
  309. cell.imageView.image = [CCGraphics changeThemingColorImage:[UIImage imageNamed:@"folder"] multiplier:2 color:[NCBrandColor sharedInstance].brandElement];
  310. } else {
  311. UIImage *thumb = [UIImage imageWithContentsOfFile:[CCUtility getDirectoryProviderStorageIconFileID:metadata.fileID fileNameView:metadata.fileNameView]];
  312. if (thumb) {
  313. cell.imageView.image = thumb;
  314. } else {
  315. if (metadata.iconName.length > 0) {
  316. cell.imageView.image = [UIImage imageNamed:metadata.iconName];
  317. } else {
  318. cell.imageView.image = [UIImage imageNamed:@"file"];
  319. }
  320. }
  321. }
  322. cell.textLabel.text = metadata.fileNameView;
  323. cell.accessoryType = UITableViewCellAccessoryNone;
  324. return cell;
  325. }
  326. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
  327. {
  328. tableMetadata *metadata = [[NCManageDatabase sharedInstance] getMetadataAtIndexWithPredicate:predicateDataSource sorted:@"fileName" ascending:YES index:indexPath.row];
  329. if (metadata.directory) {
  330. [self performSegueDirectoryWithControlPasscode:YES];
  331. } else {
  332. if (self.selectFile) {
  333. if ([self.delegate respondsToSelector:@selector(dismissMove)])
  334. [self.delegate dismissMove];
  335. if ([self.delegate respondsToSelector:@selector(selectMetadata:serverUrl:)])
  336. [self.delegate selectMetadata:metadata serverUrl:_serverUrl];
  337. [self dismissViewControllerAnimated:YES completion:nil];
  338. }
  339. }
  340. }
  341. // MARK: - Navigation
  342. - (void)performSegueDirectoryWithControlPasscode:(BOOL)controlPasscode
  343. {
  344. NSString *nomeDir;
  345. NSIndexPath *index = [self.tableView indexPathForSelectedRow];
  346. tableMetadata *metadata = [[NCManageDatabase sharedInstance] getMetadataAtIndexWithPredicate:predicateDataSource sorted:@"fileName" ascending:YES index:index.row];
  347. // lockServerUrl
  348. NSString *lockServerUrl = [CCUtility stringAppendServerUrl:_serverUrl addFileName:metadata.fileName];
  349. // 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
  350. tableDirectory *directory = [[NCManageDatabase sharedInstance] getTableDirectoryWithPredicate:[NSPredicate predicateWithFormat:@"account == %@ AND serverUrl == %@", activeAccount, lockServerUrl]];
  351. if (directory.lock && [[CCUtility getBlockCode] length] && controlPasscode) {
  352. CCBKPasscode *viewController = [[CCBKPasscode alloc] initWithNibName:nil bundle:nil];
  353. viewController.delegate = self;
  354. //viewController.fromType = CCBKPasscodeFromLockDirectory;
  355. viewController.type = BKPasscodeViewControllerCheckPasscodeType;
  356. viewController.inputViewTitlePassword = YES;
  357. if ([CCUtility getSimplyBlockCode]) {
  358. viewController.passcodeStyle = BKPasscodeInputViewNumericPasscodeStyle;
  359. viewController.passcodeInputView.maximumLength = 6;
  360. } else {
  361. viewController.passcodeStyle = BKPasscodeInputViewNormalPasscodeStyle;
  362. viewController.passcodeInputView.maximumLength = 64;
  363. }
  364. BKTouchIDManager *touchIDManager = [[BKTouchIDManager alloc] initWithKeychainServiceName:k_serviceShareKeyChain];
  365. touchIDManager.promptText = NSLocalizedString(@"_scan_fingerprint_", nil);
  366. viewController.touchIDManager = touchIDManager;
  367. viewController.title = NSLocalizedString(@"_folder_blocked_", nil);
  368. viewController.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(passcodeViewCloseButtonPressed:)];
  369. viewController.navigationItem.leftBarButtonItem.tintColor = [UIColor blackColor];
  370. UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:viewController];
  371. [self presentViewController:navController animated:YES completion:nil];
  372. return;
  373. }
  374. nomeDir = metadata.fileName;
  375. CCMove *viewController = [[UIStoryboard storyboardWithName:@"CCMove" bundle:nil] instantiateViewControllerWithIdentifier:@"CCMoveVC"];
  376. viewController.delegate = self.delegate;
  377. viewController.includeDirectoryE2EEncryption = self.includeDirectoryE2EEncryption;
  378. viewController.includeImages = self.includeImages;
  379. viewController.move.title = self.move.title;
  380. viewController.hideCreateFolder = self.hideCreateFolder;
  381. viewController.hideMoveutton = self.hideMoveutton;
  382. viewController.selectFile = self.selectFile;
  383. viewController.type = self.type;
  384. viewController.networkingOperationQueue = self.networkingOperationQueue;
  385. viewController.passMetadata = metadata;
  386. viewController.serverUrl = [CCUtility stringAppendServerUrl:_serverUrl addFileName:nomeDir];
  387. [self.navigationController pushViewController:viewController animated:YES];
  388. }
  389. @end