Explorar el Código

remove old data

Marino Faggiana hace 7 años
padre
commit
1931951895

+ 0 - 28
Share/CCSharedDBSession.h

@@ -1,28 +0,0 @@
-//
-//  CCSharedDBSession.h
-//  Crypto Cloud Technology Nextcloud
-//
-//  Created by Marino Faggiana on 13/02/16.
-//  Copyright (c) 2017 TWS. All rights reserved.
-//
-//  Author Marino Faggiana <m.faggiana@twsweb.it>
-//
-//  This program is free software: you can redistribute it and/or modify
-//  it under the terms of the GNU General Public License as published by
-//  the Free Software Foundation, either version 3 of the License, or
-//  (at your option) any later version.
-//
-//  This program is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//  GNU General Public License for more details.
-//
-//  You should have received a copy of the GNU General Public License
-//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-//
-
-@interface CCSharedDBSession : NSObject
-
-+ (CCSharedDBSession *)sharedDBSession;
-
-@end

+ 0 - 47
Share/CCSharedDBSession.m

@@ -1,47 +0,0 @@
-//
-//  CCSharedDBSession.m
-//  Crypto Cloud Technology Nextcloud
-//
-//  Created by Marino Faggiana on 13/02/16.
-//  Copyright (c) 2017 TWS. All rights reserved.
-//
-//  Author Marino Faggiana <m.faggiana@twsweb.it>
-//
-//  This program is free software: you can redistribute it and/or modify
-//  it under the terms of the GNU General Public License as published by
-//  the Free Software Foundation, either version 3 of the License, or
-//  (at your option) any later version.
-//
-//  This program is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//  GNU General Public License for more details.
-//
-//  You should have received a copy of the GNU General Public License
-//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-//
-
-#import "CCSharedDBSession.h"
-
-@implementation CCSharedDBSession
-
-+ (CCSharedDBSession *)sharedDBSession {
-    static CCSharedDBSession *sharedDBSession;
-    @synchronized(self)
-    {
-        if (!sharedDBSession) {
-            
-            sharedDBSession = [[CCSharedDBSession alloc] init];
-        }
-        return sharedDBSession;
-    }
-}
-
-- (id)init
-{
-    self = [super init];
-    
-    return self;
-}
-
-@end

+ 0 - 1
Share/test.xt

@@ -1 +0,0 @@
-

+ 0 - 56
iOSClient/Local storage/CCLocalStorage.h

@@ -1,56 +0,0 @@
-//
-//  CCLocalStorage.h
-//  Crypto Cloud Technology Nextcloud
-//
-//  Created by Marino Faggiana on 16/01/17.
-//  Copyright (c) 2017 TWS. All rights reserved.
-//
-//  Author Marino Faggiana <m.faggiana@twsweb.it>
-//
-//  This program is free software: you can redistribute it and/or modify
-//  it under the terms of the GNU General Public License as published by
-//  the Free Software Foundation, either version 3 of the License, or
-//  (at your option) any later version.
-//
-//  This program is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//  GNU General Public License for more details.
-//
-//  You should have received a copy of the GNU General Public License
-//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-//
-
-#import <UIKit/UIKit.h>
-
-#import "CCDetail.h"
-#import "UIScrollView+EmptyDataSet.h"
-#import "TWMessageBarManager.h"
-#import "AHKActionSheet.h"
-#import "CCLocalStorageCell.h"
-#import "CCUtility.h"
-#import "CCMain.h"
-#import "CCGraphics.h"
-#import "CCAccountWeb.h"
-#import "CCBancomat.h"
-#import "CCCartaDiCredito.h"
-#import "CCCartaIdentita.h"
-#import "CCContoCorrente.h"
-#import "CCNote.h"
-#import "CCPassaporto.h"
-#import "CCPatenteGuida.h"
-
-@class tableMetadata;
-
-@interface CCLocalStorage : UIViewController <UITableViewDataSource, UITableViewDelegate, UIDocumentInteractionControllerDelegate, UIActionSheetDelegate, DZNEmptyDataSetSource, DZNEmptyDataSetDelegate, CCAccountWebDelegate, CCBancomatDelegate, CCCartaDiCreditoDelegate, CCCartaIdentitaDelegate, CCContoCorrenteDelegate, CCNoteDelegate, CCPassaportoDelegate, CCPatenteGuidaDelegate>
-
-@property (nonatomic, weak) IBOutlet UITableView *tableView;
-
-@property (nonatomic, strong) tableMetadata *metadata;
-@property (nonatomic, strong) NSString *serverUrl;
-@property (nonatomic, strong) NSString *titleViewControl;
-
-@property (nonatomic, weak) CCDetail *detailViewController;
-@property (nonatomic, strong) UIDocumentInteractionController *docController;
-
-@end

+ 0 - 466
iOSClient/Local storage/CCLocalStorage.m

@@ -1,466 +0,0 @@
-//
-//  CCLocalStorage.m
-//  Crypto Cloud Technology Nextcloud
-//
-//  Created by Marino Faggiana on 16/01/17.
-//  Copyright (c) 2017 TWS. All rights reserved.
-//
-//  Author Marino Faggiana <m.faggiana@twsweb.it>
-//
-//  This program is free software: you can redistribute it and/or modify
-//  it under the terms of the GNU General Public License as published by
-//  the Free Software Foundation, either version 3 of the License, or
-//  (at your option) any later version.
-//
-//  This program is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//  GNU General Public License for more details.
-//
-//  You should have received a copy of the GNU General Public License
-//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-//
-
-#import "CCLocalStorage.h"
-#import "AppDelegate.h"
-#import "NCBridgeSwift.h"
-
-@interface CCLocalStorage ()
-{
-    NSArray *dataSource;
-}
-@end
-
-@implementation CCLocalStorage
-
--  (id)initWithCoder:(NSCoder *)aDecoder
-{
-    if (self = [super initWithCoder:aDecoder])  {
-        
-        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeTheming) name:@"changeTheming" object:nil];
-    }
-    
-    return self;
-}
-
-- (void)viewDidLoad
-{
-    [super viewDidLoad];
-    
-    // Custom Cell
-    [self.tableView registerNib:[UINib nibWithNibName:@"CCLocalStorageCell" bundle:nil] forCellReuseIdentifier:@"Cell"];
-
-    // dataSource
-    dataSource = [NSMutableArray new];
-    
-    // Metadata
-    _metadata = [tableMetadata new];
-    
-    self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.tableView.frame.size.width, 1)];
-    self.tableView.separatorColor = [NCBrandColor sharedInstance].seperator;
-    self.tableView.emptyDataSetDelegate = self;
-    self.tableView.emptyDataSetSource = self;
-    self.tableView.allowsMultipleSelectionDuringEditing = NO;
-    
-    // ServerUrl
-    if (!_serverUrl)
-        _serverUrl = [CCUtility getDirectoryLocal];
-    
-    // Title
-    if (_titleViewControl)
-        self.title = _titleViewControl;
-    else
-        self.title = NSLocalizedString(@"_local_storage_", nil);
-}
-
-// Apparirà
-- (void)viewWillAppear:(BOOL)animated
-{
-    [super viewWillAppear:animated];
-    
-    // Color
-    [app aspectNavigationControllerBar:self.navigationController.navigationBar encrypted:NO online:[app.reachability isReachable] hidden:NO];
-    [app aspectTabBar:self.tabBarController.tabBar hidden:NO];
-    
-    // Plus Button
-    [app plusButtonVisibile:true];
-    
-    [self reloadDatasource];
-}
-
-- (void)changeTheming
-{
-    if (self.isViewLoaded && self.view.window)
-        [app changeTheming:self];
-}
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ==== DZNEmptyDataSetSource ====
-#pragma --------------------------------------------------------------------------------------------
-
-- (BOOL)emptyDataSetShouldDisplay:(UIScrollView *)scrollView
-{
-    // only for root
-    if ([_serverUrl isEqualToString:[CCUtility getDirectoryLocal]])
-        return YES;
-    else
-        return NO;
-}
-
-- (CGFloat)spaceHeightForEmptyDataSet:(UIScrollView *)scrollView
-{
-    return 0.0f;
-}
-
-- (UIColor *)backgroundColorForEmptyDataSet:(UIScrollView *)scrollView
-{
-    return [UIColor whiteColor];
-}
-
-- (UIImage *)imageForEmptyDataSet:(UIScrollView *)scrollView
-{
-    return [UIImage imageNamed:@"localStorageNoRecord"];
-}
-
-- (NSAttributedString *)titleForEmptyDataSet:(UIScrollView *)scrollView
-{
-    NSString *text = [NSString stringWithFormat:@"%@", NSLocalizedString(@"_local_storage_no_record_", nil)];
-    
-    NSDictionary *attributes = @{NSFontAttributeName:[UIFont boldSystemFontOfSize:20.0f], NSForegroundColorAttributeName:[UIColor lightGrayColor]};
-    
-    return [[NSAttributedString alloc] initWithString:text attributes:attributes];
-}
-
-- (NSAttributedString *)descriptionForEmptyDataSet:(UIScrollView *)scrollView
-{
-    NSString *text = [NSString stringWithFormat:@"\n%@", NSLocalizedString(@"_tutorial_local_view_", nil)];
-    
-    NSMutableParagraphStyle *paragraph = [NSMutableParagraphStyle new];
-    paragraph.lineBreakMode = NSLineBreakByWordWrapping;
-    paragraph.alignment = NSTextAlignmentCenter;
-    
-    NSDictionary *attributes = @{NSFontAttributeName: [UIFont systemFontOfSize:14.0], NSForegroundColorAttributeName: [UIColor lightGrayColor], NSParagraphStyleAttributeName: paragraph};
-    
-    return [[NSAttributedString alloc] initWithString:text attributes:attributes];
-}
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ===== menu =====
-#pragma--------------------------------------------------------------------------------------------
-
-- (void)openModel:(tableMetadata *)metadata
-{
-    UIViewController *viewController;
-    BOOL isLocal = YES;
-    NSString *serverUrl = [[NCManageDatabase sharedInstance] getServerUrl:_metadata.directoryID];
-    
-    if ([metadata.model isEqualToString:@"cartadicredito"])
-        viewController = [[CCCartaDiCredito alloc] initWithDelegate:self fileName:metadata.fileName uuid:metadata.uuid fileID:metadata.fileID isLocal:isLocal serverUrl:serverUrl];
-    
-    if ([metadata.model isEqualToString:@"bancomat"])
-        viewController = [[CCBancomat alloc] initWithDelegate:self fileName:metadata.fileName uuid:metadata.uuid fileID:metadata.fileID isLocal:isLocal serverUrl:serverUrl];
-    
-    if ([metadata.model isEqualToString:@"contocorrente"])
-        viewController = [[CCContoCorrente alloc] initWithDelegate:self fileName:metadata.fileName uuid:metadata.uuid fileID:metadata.fileID isLocal:isLocal serverUrl:serverUrl];
-    
-    if ([metadata.model isEqualToString:@"accountweb"])
-        viewController = [[CCAccountWeb alloc] initWithDelegate:self fileName:metadata.fileName uuid:metadata.uuid fileID:metadata.fileID isLocal:isLocal serverUrl:serverUrl];
-    
-    if ([metadata.model isEqualToString:@"patenteguida"])
-        viewController = [[CCPatenteGuida alloc] initWithDelegate:self fileName:metadata.fileName uuid:metadata.uuid fileID:metadata.fileID isLocal:isLocal serverUrl:serverUrl];
-    
-    if ([metadata.model isEqualToString:@"cartaidentita"])
-        viewController = [[CCCartaIdentita alloc] initWithDelegate:self fileName:metadata.fileName uuid:metadata.uuid fileID:metadata.fileID isLocal:isLocal serverUrl:serverUrl];
-    
-    if ([metadata.model isEqualToString:@"passaporto"])
-        viewController = [[CCPassaporto alloc] initWithDelegate:self fileName:metadata.fileName uuid:metadata.uuid fileID:metadata.fileID isLocal:isLocal serverUrl:serverUrl];
-    
-    if ([metadata.model isEqualToString:@"note"]) {
-        
-        viewController = [[CCNote alloc] initWithDelegate:self fileName:metadata.fileName uuid:metadata.uuid fileID:metadata.fileID isLocal:isLocal serverUrl:serverUrl];
-        
-        UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:viewController];
-        
-        [self presentViewController:navigationController animated:YES completion:nil];
-        
-    } else {
-        
-        UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:viewController];
-        
-        [navigationController setModalPresentationStyle:UIModalPresentationFormSheet];
-        
-        [self presentViewController:navigationController animated:YES completion:nil];
-    }
-}
-
-- (void)openWith:(tableMetadata *)metadata
-{
-    NSString *fileNamePath = [NSString stringWithFormat:@"%@/%@", _serverUrl, metadata.fileNameData];
-        
-    if ([[NSFileManager defaultManager] fileExistsAtPath:fileNamePath]) {
-        
-        [[NSFileManager defaultManager] removeItemAtPath:[NSTemporaryDirectory() stringByAppendingString:metadata.fileNamePrint] error:nil];
-        [[NSFileManager defaultManager] linkItemAtPath:fileNamePath toPath:[NSTemporaryDirectory() stringByAppendingString:metadata.fileNamePrint] error:nil];
-        
-        NSURL *url = [NSURL fileURLWithPath:[NSTemporaryDirectory() stringByAppendingString:metadata.fileNamePrint]];
-        
-        _docController = [UIDocumentInteractionController interactionControllerWithURL:url];
-        _docController.delegate = self;
-        
-        [_docController presentOptionsMenuFromRect:self.view.frame inView:self.view animated:YES];
-    }
-}
-
-- (void)requestDeleteMetadata:(tableMetadata *)metadata indexPath:(NSIndexPath *)indexPath
-{
-    UIAlertController *alertController = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];
-        
-    [alertController addAction: [UIAlertAction actionWithTitle:NSLocalizedString(@"_delete_", nil) style:UIAlertActionStyleDestructive handler:^(UIAlertAction *action) {
-        
-        NSString *fileNamePath = [NSString stringWithFormat:@"%@/%@", _serverUrl, metadata.fileNameData];
-        NSString *iconPath = [NSString stringWithFormat:@"%@/.%@.ico", _serverUrl, metadata.fileNameData];
-                                                                   
-        [[NSFileManager defaultManager] removeItemAtPath:fileNamePath error:nil];
-        [[NSFileManager defaultManager] removeItemAtPath:iconPath error:nil];
-        
-                                                               
-        [self reloadDatasource];
-    }]];
-        
-        
-    [alertController addAction: [UIAlertAction actionWithTitle:NSLocalizedString(@"_cancel_", nil) style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
-    }]];
-        
-    alertController.popoverPresentationController.sourceView = self.view;
-    alertController.popoverPresentationController.sourceRect = [self.tableView rectForRowAtIndexPath:indexPath];
-        
-    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
-        [alertController.view layoutIfNeeded];
-        
-    [self presentViewController:alertController animated:YES completion:nil];
-}
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ==== Table ====
-#pragma --------------------------------------------------------------------------------------------
-
-- (tableMetadata *)setSelfMetadataFromIndexPath:(NSIndexPath *)indexPath
-{
-    NSString *autoUploadFileName = [[NCManageDatabase sharedInstance] getAccountAutoUploadFileName];
-    NSString *AutoUploadDirectory = [[NCManageDatabase sharedInstance] getAccountAutoUploadDirectory:app.activeUrl];
-        
-    return [CCUtility insertFileSystemInMetadata:[dataSource objectAtIndex:indexPath.row] directory:_serverUrl activeAccount:app.activeAccount autoUploadFileName:autoUploadFileName autoUploadDirectory:AutoUploadDirectory];
-}
-
-- (void)readFolder:(NSString *)serverUrl
-{
-    [self reloadDatasource];
-}
-
-- (void)reloadDatasource
-{
-    NSArray *subpaths = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:_serverUrl error:nil];
-    NSMutableArray *metadatas = [NSMutableArray new];
-        
-    for (NSString *subpath in subpaths)
-        if (![[subpath lastPathComponent] hasPrefix:@"."])
-            [metadatas addObject:subpath];
-        
-    dataSource = [NSArray arrayWithArray:metadatas];
-    
-    [self.tableView reloadData];
-}
-
-- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
-{
-    return 60;
-}
-
-- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
-{
-    return 1;
-}
-
-- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
-{
-    return [dataSource count];
-}
-
-- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
-{
-    CCLocalStorageCell *cell = (CCLocalStorageCell *)[tableView dequeueReusableCellWithIdentifier:@"Cell" forIndexPath:indexPath];
-    tableMetadata *metadata;
-    
-    // separator
-    cell.separatorInset = UIEdgeInsetsMake(0.f, 60.f, 0.f, 0.f);
-    
-    // Initialize
-    cell.statusImageView.image = nil;
-    cell.offlineImageView.image = nil;
-    
-    // change color selection
-    UIView *selectionColor = [[UIView alloc] init];
-    selectionColor.backgroundColor = [[NCBrandColor sharedInstance] getColorSelectBackgrond];
-    cell.selectedBackgroundView = selectionColor;
-    
-    NSString *autoUploadFileName = [[NCManageDatabase sharedInstance] getAccountAutoUploadFileName];
-    NSString *autoUploadDirectory = [[NCManageDatabase sharedInstance] getAccountAutoUploadDirectory:app.activeUrl];
-        
-    metadata = [CCUtility insertFileSystemInMetadata:[dataSource objectAtIndex:indexPath.row] directory:_serverUrl activeAccount:app.activeAccount autoUploadFileName:autoUploadFileName autoUploadDirectory:autoUploadDirectory];
-        
-    cell.fileImageView.image = [UIImage imageWithContentsOfFile:[NSString stringWithFormat:@"%@/.%@.ico", _serverUrl, metadata.fileNamePrint]];
-        
-    if (!cell.fileImageView.image) {
-            
-        UIImage *icon = [CCGraphics createNewImageFrom:metadata.fileID directoryUser:_serverUrl fileNameTo:metadata.fileID fileNamePrint:metadata.fileNamePrint size:@"m" imageForUpload:NO typeFile:metadata.typeFile writePreview:NO optimizedFileName:[CCUtility getOptimizedPhoto]];
-            
-        if (icon) {
-            [CCGraphics saveIcoWithEtag:metadata.fileNamePrint image:icon writeToFile:[NSString stringWithFormat:@"%@/.%@.ico", _serverUrl, metadata.fileNamePrint] copy:NO move:NO fromPath:nil toPath:nil];
-            cell.fileImageView.image = icon;
-        }
-    }
-    
-    // encrypted color
-    if (metadata.cryptated) {
-        cell.labelTitle.textColor = [NCBrandColor sharedInstance].cryptocloud;
-    } else {
-        cell.labelTitle.textColor = [UIColor blackColor];
-    }
-    
-    // File name
-    cell.labelTitle.text = metadata.fileNamePrint;
-    cell.labelInfoFile.text = @"";
-    
-    // Immagine del file, se non c'è l'anteprima mettiamo quella standard
-    if (cell.fileImageView.image == nil)
-        cell.fileImageView.image = [UIImage imageNamed:metadata.iconName];
-    
-    // it's encrypted ???
-    if (metadata.cryptated && [metadata.type isEqualToString: k_metadataType_template] == NO)
-        cell.statusImageView.image = [UIImage imageNamed:@"lock"];
-    
-    // text and length
-    if (metadata.directory) {
-        
-        cell.labelInfoFile.text = [CCUtility dateDiff:metadata.date];
-        cell.accessoryType = UITableViewCellAccessoryNone;
-        //cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
-          
-    } else {
-        
-        NSString *date = [CCUtility dateDiff:metadata.date];
-        NSString *length = [CCUtility transformedSize:metadata.size];
-        
-        if ([metadata.type isEqualToString: k_metadataType_template])
-            cell.labelInfoFile.text = [NSString stringWithFormat:@"%@", date];
-        
-        if ([metadata.type isEqualToString: k_metadataType_file] || [metadata.type isEqualToString: k_metadataType_local])
-            cell.labelInfoFile.text = [NSString stringWithFormat:@"%@ • %@", date, length];
-        
-        cell.accessoryType = UITableViewCellAccessoryNone;
-    }
-    
-    return cell;
-}
-
-- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
-{
-    // deselect row
-    [tableView deselectRowAtIndexPath:indexPath animated:YES];
-    
-    _metadata = [self setSelfMetadataFromIndexPath:indexPath];
-    
-    // if is in download [do not touch]
-    if ([_metadata.session length] > 0 && [_metadata.session containsString:@"download"])
-        return;
-    
-    // File
-    if (([_metadata.type isEqualToString: k_metadataType_file] || [_metadata.type isEqualToString: k_metadataType_local]) && _metadata.directory == NO) {
-        
-        if ([_metadata.typeFile isEqualToString: k_metadataTypeFile_unknown] || [_metadata.typeFile isEqualToString: k_metadataTypeFile_compress]) {
-            
-            [self openWith:_metadata];
-            
-        } else {
-        
-            if ([self shouldPerformSegue])
-                [self performSegueWithIdentifier:@"segueDetail" sender:self];
-        }
-    }
-    
-    // Model
-    if ([self.metadata.type isEqualToString: k_metadataType_template])
-        [self openModel:_metadata];
-    
-    // Directory
-    if (_metadata.directory)
-        [self performSegueDirectoryWithControlPasscode];
-}
-
--(void)performSegueDirectoryWithControlPasscode
-{
-    CCLocalStorage *vc = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"CCLocalStorage"];
-    
-    vc.serverUrl = [CCUtility stringAppendServerUrl:_serverUrl addFileName:_metadata.fileNameData];
-    vc.titleViewControl = _metadata.fileNamePrint;
-    
-    [self.navigationController pushViewController:vc animated:YES];
-}
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ===== Navigation ====
-#pragma --------------------------------------------------------------------------------------------
-
-- (BOOL)shouldPerformSegue
-{
-    // if i am in background -> exit
-    if ([[UIApplication sharedApplication] applicationState] == UIApplicationStateBackground) return NO;
-    
-    // if i am not window -> exit
-    if (self.view.window == NO)
-        return NO;
-    
-    // Collapsed but i am in detail -> exit
-    if (self.splitViewController.isCollapsed)
-        if (self.detailViewController.isViewLoaded && self.detailViewController.view.window) return NO;
-    
-    // Video in run -> exit
-    if (self.detailViewController.photoBrowser.currentVideoPlayerViewController.isViewLoaded && self.detailViewController.photoBrowser.currentVideoPlayerViewController.view.window) return NO;
-    
-    return YES;
-}
-
--(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
-{
-    id viewController = segue.destinationViewController;
-    
-    if ([viewController isKindOfClass:[UINavigationController class]]) {
-        UINavigationController *nav = viewController;
-        _detailViewController = (CCDetail *)nav.topViewController;
-    } else {
-        _detailViewController = segue.destinationViewController;
-    }
-    
-    NSMutableArray *allRecordsDataSourceImagesVideos = [NSMutableArray new];
-    
-    NSString *autoUploadFileName = [[NCManageDatabase sharedInstance] getAccountAutoUploadFileName];
-    NSString *autoUploadDirectory = [[NCManageDatabase sharedInstance] getAccountAutoUploadDirectory:app.activeUrl];
-        
-    for (NSString *fileName in dataSource) {
-            
-        tableMetadata *metadata = [tableMetadata new];
-        metadata = [CCUtility insertFileSystemInMetadata:fileName directory:_serverUrl activeAccount:app.activeAccount autoUploadFileName:autoUploadFileName autoUploadDirectory:autoUploadDirectory];
-            
-        if ([metadata.typeFile isEqualToString: k_metadataTypeFile_image] || [metadata.typeFile isEqualToString: k_metadataTypeFile_video])
-            [allRecordsDataSourceImagesVideos addObject:metadata];
-    }
-        
-    _detailViewController.sourceDirectoryLocal = YES;
-    _detailViewController.metadataDetail = _metadata;
-    _detailViewController.dateFilterQuery = nil;
-    _detailViewController.dataSourceImagesVideos = allRecordsDataSourceImagesVideos;
-
-    [_detailViewController setTitle:_metadata.fileNamePrint];
-}
-
-@end

+ 0 - 45
iOSClient/Local storage/CCLocalStorageCell.h

@@ -1,45 +0,0 @@
-//
-//  CCLocalStorageCell.h
-//  Crypto Cloud Technology Nextcloud
-//
-//  Created by Marino Faggiana on 05/05/15.
-//  Copyright (c) 2017 TWS. All rights reserved.
-//
-//  Author Marino Faggiana <m.faggiana@twsweb.it>
-//
-//  This program is free software: you can redistribute it and/or modify
-//  it under the terms of the GNU General Public License as published by
-//  the Free Software Foundation, either version 3 of the License, or
-//  (at your option) any later version.
-//
-//  This program is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//  GNU General Public License for more details.
-//
-//  You should have received a copy of the GNU General Public License
-//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-//
-
-#import <UIKit/UIKit.h>
-
-@interface CCLocalStorageCell : UITableViewCell
-
-@property(nonatomic, weak) IBOutlet UIImageView *fileImageView;
-@property(nonatomic, weak) IBOutlet UIImageView *statusImageView;
-@property(nonatomic, weak) IBOutlet UIImageView *offlineImageView;
-
-@property(nonatomic, weak) IBOutlet UILabel *labelTitle;
-@property(nonatomic, weak) IBOutlet UILabel *labelInfoFile;
-
-@property(nonatomic, weak) IBOutlet UIButton *buttonDown;
-
-@property (strong, nonatomic) IBOutletCollection(NSLayoutConstraint) NSArray *constraints;
-
-//Last position of the scroll of the swipe
-@property (nonatomic, assign) CGFloat lastContentOffset;
-
-//Index path of the cell swipe gesture ocured
-@property (nonatomic, strong) NSIndexPath *indexPath;
-
-@end

+ 0 - 68
iOSClient/Local storage/CCLocalStorageCell.m

@@ -1,68 +0,0 @@
-//
-//  CCCellOffline.m
-//  Crypto Cloud Technology Nextcloud
-//
-//  Created by Marino Faggiana on 05/05/15.
-//  Copyright (c) 2017 TWS. All rights reserved.
-//
-//  Author Marino Faggiana <m.faggiana@twsweb.it>
-//
-//  This program is free software: you can redistribute it and/or modify
-//  it under the terms of the GNU General Public License as published by
-//  the Free Software Foundation, either version 3 of the License, or
-//  (at your option) any later version.
-//
-//  This program is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//  GNU General Public License for more details.
-//
-//  You should have received a copy of the GNU General Public License
-//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-//
-
-#import "CCLocalStorageCell.h"
-
-@implementation CCLocalStorageCell
-
-- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
-{
-    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
-    if (self) {
-        // Initialization code
-
-        
-    }
-    return self;
-}
-
-- (void)setSelected:(BOOL)selected animated:(BOOL)animated
-{
-    [super setSelected:selected animated:animated];
-
-    // Configure the view for the selected state
-}
-
-- (void)layoutSubviews {
-    
-    [super layoutSubviews];
-    
-    for (NSLayoutConstraint *constraint in self.constraints) {
-        constraint.constant = self.frame.size.width - self.contentView.frame.size.width;
-    }
-}
-
-///-----------------------------------
-/// @name scrollViewWillBeginDecelerating
-///-----------------------------------
-
-/**
- * Method to initialize the position where we make the swipe in order to detect the direction
- *
- * @param UIScrollView -> scrollView
- */
-- (void)scrollViewWillBeginDecelerating:(UIScrollView *)scrollView {
-    _lastContentOffset = scrollView.contentOffset.x;
-}
-
-@end

+ 0 - 81
iOSClient/Local storage/CCLocalStorageCell.xib

@@ -1,81 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="12118" systemVersion="16E195" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES">
-    <device id="retina4_7" orientation="portrait">
-        <adaptation id="fullscreen"/>
-    </device>
-    <dependencies>
-        <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12086"/>
-        <capability name="Constraints to layout margins" minToolsVersion="6.0"/>
-        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
-    </dependencies>
-    <objects>
-        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="CustomCellFileAndDirectory"/>
-        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
-        <tableViewCell contentMode="scaleToFill" selectionStyle="blue" indentationWidth="0.0" reuseIdentifier="Cell" rowHeight="60" id="2" userLabel="CCLocalStorageCell" customClass="CCLocalStorageCell">
-            <rect key="frame" x="0.0" y="0.0" width="600" height="60"/>
-            <autoresizingMask key="autoresizingMask" flexibleMaxY="YES"/>
-            <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="2" id="sQq-jC-UEV">
-                <rect key="frame" x="0.0" y="0.0" width="600" height="59.5"/>
-                <autoresizingMask key="autoresizingMask"/>
-                <subviews>
-                    <label opaque="NO" userInteractionEnabled="NO" tag="101" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="QNC-8X-DAC">
-                        <rect key="frame" x="60" y="13" width="481" height="20"/>
-                        <fontDescription key="fontDescription" type="system" pointSize="16"/>
-                        <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
-                        <nil key="highlightedColor"/>
-                    </label>
-                    <label opaque="NO" userInteractionEnabled="NO" tag="102" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="p7I-KN-FVZ">
-                        <rect key="frame" x="60" y="33" width="481" height="15"/>
-                        <fontDescription key="fontDescription" type="system" pointSize="12"/>
-                        <color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
-                        <nil key="highlightedColor"/>
-                    </label>
-                    <button opaque="NO" alpha="0.40000000000000002" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="6B9-Jc-esJ" userLabel="buttonDown">
-                        <rect key="frame" x="541" y="0.0" width="60" height="60"/>
-                        <constraints>
-                            <constraint firstAttribute="height" constant="60" id="PcN-jN-71v"/>
-                            <constraint firstAttribute="width" constant="60" id="bAG-EX-HKe"/>
-                        </constraints>
-                        <state key="normal" image="buttonDown"/>
-                    </button>
-                    <imageView userInteractionEnabled="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="5">
-                        <rect key="frame" x="10" y="10" width="40" height="40"/>
-                        <constraints>
-                            <constraint firstAttribute="width" constant="40" id="7r4-ao-ayY"/>
-                            <constraint firstAttribute="height" constant="40" id="cGI-9B-eWe"/>
-                        </constraints>
-                    </imageView>
-                </subviews>
-                <constraints>
-                    <constraint firstItem="QNC-8X-DAC" firstAttribute="trailing" secondItem="sQq-jC-UEV" secondAttribute="trailingMargin" constant="-51" id="7zt-c0-CsI"/>
-                    <constraint firstItem="p7I-KN-FVZ" firstAttribute="leading" secondItem="sQq-jC-UEV" secondAttribute="leadingMargin" constant="52" id="Lgb-6q-pd1"/>
-                    <constraint firstItem="p7I-KN-FVZ" firstAttribute="top" secondItem="sQq-jC-UEV" secondAttribute="topMargin" constant="25" id="Ofy-42-gUb"/>
-                    <constraint firstItem="QNC-8X-DAC" firstAttribute="top" secondItem="sQq-jC-UEV" secondAttribute="topMargin" constant="5" id="Wks-nJ-JjF"/>
-                    <constraint firstItem="5" firstAttribute="leading" secondItem="sQq-jC-UEV" secondAttribute="leadingMargin" constant="2" id="asm-5P-8p8"/>
-                    <constraint firstItem="5" firstAttribute="centerY" secondItem="sQq-jC-UEV" secondAttribute="centerY" id="b3N-Ho-wsM"/>
-                    <constraint firstItem="p7I-KN-FVZ" firstAttribute="trailing" secondItem="sQq-jC-UEV" secondAttribute="trailingMargin" constant="-51" id="kaB-WS-bDl"/>
-                    <constraint firstItem="6B9-Jc-esJ" firstAttribute="leading" secondItem="QNC-8X-DAC" secondAttribute="trailing" id="mBS-nt-t6R"/>
-                    <constraint firstItem="QNC-8X-DAC" firstAttribute="leading" secondItem="sQq-jC-UEV" secondAttribute="leadingMargin" constant="52" id="prQ-27-bk0"/>
-                    <constraint firstItem="6B9-Jc-esJ" firstAttribute="centerY" secondItem="sQq-jC-UEV" secondAttribute="centerY" id="xuI-qH-BjK"/>
-                </constraints>
-            </tableViewCellContentView>
-            <connections>
-                <outlet property="buttonDown" destination="6B9-Jc-esJ" id="tb8-y2-OM0"/>
-                <outlet property="fileImageView" destination="5" id="6"/>
-                <outlet property="labelInfoFile" destination="p7I-KN-FVZ" id="5Yb-hH-k73"/>
-                <outlet property="labelTitle" destination="QNC-8X-DAC" id="dFX-Cb-8IE"/>
-                <outletCollection property="constraints" destination="mBS-nt-t6R" id="4sz-P1-CPa"/>
-            </connections>
-            <point key="canvasLocation" x="316" y="128"/>
-        </tableViewCell>
-    </objects>
-    <resources>
-        <image name="buttonDown" width="25" height="25"/>
-    </resources>
-    <simulatedMetricsContainer key="defaultSimulatedMetrics">
-        <simulatedStatusBarMetrics key="statusBar"/>
-        <simulatedOrientationMetrics key="orientation"/>
-        <simulatedScreenMetrics key="destination" type="retina4_7.fullscreen"/>
-    </simulatedMetricsContainer>
-</document>

+ 0 - 44
iOSClient/ManageLocation+ManageAsset/NCRequestAsset.h

@@ -1,44 +0,0 @@
-//
-//  NCRequestAsset.h
-//  Nextcloud
-//
-//  Created by Marino Faggiana on 16/06/17.
-//  Copyright © 2017 TWS. All rights reserved.
-//
-//  Author Marino Faggiana <m.faggiana@twsweb.it>
-//
-//  This program is free software: you can redistribute it and/or modify
-//  it under the terms of the GNU General Public License as published by
-//  the Free Software Foundation, either version 3 of the License, or
-//  (at your option) any later version.
-//
-//  This program is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//  GNU General Public License for more details.
-//
-//  You should have received a copy of the GNU General Public License
-//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-//
-
-#import <Foundation/Foundation.h>
-#import <Photos/Photos.h>
-#import "CCNetworking.h"
-
-@protocol NCRequestAssetDelegate;
-
-@interface NCRequestAsset : NSObject
-
-@property (nonatomic, weak) id <NCRequestAssetDelegate> delegate;
-
-- (void)writeAssetToSandboxFileName:(NSString *)fileName assetLocalIdentifier:(NSString *)assetLocalIdentifier selector:(NSString *)selector selectorPost:(NSString *)selectorPost errorCode:(NSInteger)errorCode metadataNet:(CCMetadataNet *)metadataNet serverUrl:(NSString *)serverUrl activeUrl:(NSString *)activeUrl directoryUser:(NSString *)directoryUser cryptated:(BOOL)cryptated session:(NSString *)session taskStatus:(NSInteger)taskStatus delegate:(id)delegate;
-
-@end
-
-@protocol NCRequestAssetDelegate <NSObject>
-
-@optional - (void)addDatabaseAutoUpload:(CCMetadataNet *)metadataNet asset:(PHAsset *)asset;
-
-@optional - (void)upload:(NSString *)fileName serverUrl:(NSString *)serverUrl cryptated:(BOOL)cryptated template:(BOOL)template onlyPlist:(BOOL)onlyPlist fileNameTemplate:(NSString *)fileNameTemplate assetLocalIdentifier:(NSString *)assetLocalIdentifier session:(NSString *)session taskStatus:(NSInteger)taskStatus selector:(NSString *)selector selectorPost:(NSString *)selectorPost errorCode:(NSInteger)errorCode delegate:(id)delegate;
-
-@end

+ 0 - 176
iOSClient/ManageLocation+ManageAsset/NCRequestAsset.m

@@ -1,176 +0,0 @@
-//
-//  NCRequestAsset.m
-//  Nextcloud
-//
-//  Created by Marino Faggiana on 16/06/17.
-//  Copyright © 2017 TWS. All rights reserved.
-//
-
-#import "NCRequestAsset.h"
-#import "AppDelegate.h"
-
-#import "NCBridgeSwift.h"
-
-@implementation NCRequestAsset
-
-- (void)writeAssetToSandboxFileName:(NSString *)fileName assetLocalIdentifier:(NSString *)assetLocalIdentifier selector:(NSString *)selector selectorPost:(NSString *)selectorPost errorCode:(NSInteger)errorCode metadataNet:(CCMetadataNet *)metadataNet serverUrl:(NSString *)serverUrl activeUrl:(NSString *)activeUrl directoryUser:(NSString *)directoryUser cryptated:(BOOL)cryptated session:(NSString *)session taskStatus:(NSInteger)taskStatus delegate:(id)delegate
-{
-    PHFetchResult *result = [PHAsset fetchAssetsWithLocalIdentifiers:@[assetLocalIdentifier] options:nil];
-    
-    if (!result.count) {
-        
-        [[NCManageDatabase sharedInstance] addActivityClient:fileName fileID:assetLocalIdentifier action:k_activityDebugActionUpload selector:selector note:@"Internal error image/video not found" type:k_activityTypeFailure verbose:k_activityVerboseHigh activeUrl:activeUrl];
-        
-        dispatch_async(dispatch_get_main_queue(), ^{
-            if (delegate)
-                if ([delegate respondsToSelector:@selector(uploadFileFailure:fileID:serverUrl:selector:message:errorCode:)])
-                    [delegate uploadFileFailure:nil fileID:nil serverUrl:serverUrl selector:selector message:@"Internal error image/video not found" errorCode: k_CCErrorInternalError];
-        });
-        
-        return;
-    }
-
-    PHAsset *assetResult = result[0];
-    PHAssetMediaType assetMediaType = assetResult.mediaType;
-    
-    // VIDEO
-    if (assetMediaType == PHAssetMediaTypeVideo) {
-
-        @autoreleasepool {
-        
-            __block PHAsset *asset = result[0];
-            __block NSError *error = nil;
-
-            dispatch_semaphore_t semaphoreGroup = dispatch_semaphore_create(0);
-
-            PHVideoRequestOptions *options = [PHVideoRequestOptions new];
-            options.networkAccessAllowed = YES; // iCloud
-            
-            [[PHImageManager defaultManager] requestPlayerItemForVideo:asset options:options resultHandler:^(AVPlayerItem * _Nullable playerItem, NSDictionary * _Nullable info) {
-                
-                if ([[NSFileManager defaultManager] fileExistsAtPath:[NSString stringWithFormat:@"%@/%@", directoryUser, fileName]])
-                    [[NSFileManager defaultManager] removeItemAtPath:[NSString stringWithFormat:@"%@/%@", directoryUser, fileName] error:nil];
-                
-                AVAssetExportSession *exportSession = [[AVAssetExportSession alloc] initWithAsset:playerItem.asset presetName:AVAssetExportPresetHighestQuality];
-                
-                if (exportSession) {
-                    
-                    exportSession.outputURL = [NSURL fileURLWithPath:[NSString stringWithFormat:@"%@/%@", directoryUser, fileName]];
-                    exportSession.outputFileType = AVFileTypeQuickTimeMovie;
-                    
-                    [exportSession exportAsynchronouslyWithCompletionHandler:^{
-                        
-                        dispatch_semaphore_signal(semaphoreGroup);
-                        
-                        if (AVAssetExportSessionStatusCompleted == exportSession.status) {
-                            
-                            //OK selectorUploadAutoUpload
-                            if ([selector isEqualToString:selectorUploadAutoUpload]) {
-                                if ([self.delegate respondsToSelector:@selector(addDatabaseAutoUpload:asset:)])
-                                    [self.delegate addDatabaseAutoUpload:metadataNet asset:asset];
-                            } else {
-                                if ([self.delegate respondsToSelector:@selector(upload:serverUrl:cryptated:template:onlyPlist:fileNameTemplate:assetLocalIdentifier:session:taskStatus:selector:selectorPost:errorCode:delegate:)])
-                                    [self.delegate upload:fileName serverUrl:serverUrl cryptated:cryptated template:NO onlyPlist:NO fileNameTemplate:nil assetLocalIdentifier:assetLocalIdentifier session:session taskStatus:taskStatus selector:selector selectorPost:selectorPost errorCode:errorCode delegate:delegate];
-                            }
-                            
-                        } else if (AVAssetExportSessionStatusFailed == exportSession.status) {
-                            
-                            // Delete record on Table Auto Upload
-                            if ([selector isEqualToString:selectorUploadAutoUpload] || [selector isEqualToString:selectorUploadAutoUploadAll])
-                                [[NCManageDatabase sharedInstance] deleteAutoUploadWithAssetLocalIdentifier:assetLocalIdentifier];
-                            
-                            // Activity
-                            [[NCManageDatabase sharedInstance] addActivityClient:fileName fileID:assetLocalIdentifier action:k_activityDebugActionUpload selector:selector note:[NSString stringWithFormat:@"%@ [%@]",NSLocalizedString(@"_read_file_error_", nil), error.description] type:k_activityTypeFailure verbose:k_activityVerboseDefault activeUrl:activeUrl];
-                            
-                            // Error for uploadFileFailure
-                            dispatch_async(dispatch_get_main_queue(), ^{
-                                if (delegate)
-                                    if ([delegate respondsToSelector:@selector(uploadFileFailure:fileID:serverUrl:selector:message:errorCode:)])
-                                        [delegate uploadFileFailure:nil fileID:nil serverUrl:serverUrl selector:selector message:@"_read_file_error_" errorCode:[NSError errorWithDomain:@"it.twsweb.cryptocloud" code:kCFURLErrorFileDoesNotExist userInfo:nil].code];
-                            });
-                            
-                        } else {
-                            NSLog(@"Export Session Status: %ld", (long)exportSession.status);
-                        }
-                    }];
-                    
-                } else {
-                    
-                    dispatch_semaphore_signal(semaphoreGroup);
-                    
-                    // Delete record on Table Auto Upload
-                    if ([selector isEqualToString:selectorUploadAutoUpload] || [selector isEqualToString:selectorUploadAutoUploadAll])
-                        [[NCManageDatabase sharedInstance] deleteAutoUploadWithAssetLocalIdentifier:assetLocalIdentifier];
-                    
-                    // Activity
-                    [[NCManageDatabase sharedInstance] addActivityClient:fileName fileID:assetLocalIdentifier action:k_activityDebugActionUpload selector:selector note:[NSString stringWithFormat:@"%@ [%@]",NSLocalizedString(@"_read_file_error_", nil), error.description] type:k_activityTypeFailure verbose:k_activityVerboseDefault activeUrl:activeUrl];
-                    
-                    // Error for uploadFileFailure
-                    dispatch_async(dispatch_get_main_queue(), ^{
-                        if (delegate)
-                            if ([delegate respondsToSelector:@selector(uploadFileFailure:fileID:serverUrl:selector:message:errorCode:)])
-                                [delegate uploadFileFailure:nil fileID:nil serverUrl:serverUrl selector:selector message:@"_read_file_error_" errorCode:[NSError errorWithDomain:@"it.twsweb.cryptocloud" code:kCFURLErrorFileDoesNotExist userInfo:nil].code];
-                    });
-                }                
-            }];
-            
-            while (dispatch_semaphore_wait(semaphoreGroup, DISPATCH_TIME_NOW))
-                [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]];
-        }
-    }
-    
-    // IMAGE
-    if (assetMediaType == PHAssetMediaTypeImage) {
-        
-        @autoreleasepool {
-            
-            __block PHAsset *asset = result[0];
-            __block NSError *error = nil;
-        
-            dispatch_semaphore_t semaphoreGroup = dispatch_semaphore_create(0);
-            
-            PHImageRequestOptions *options = [PHImageRequestOptions new];
-            options.networkAccessAllowed = YES; // iCloud
-            
-            [[PHImageManager defaultManager] requestImageDataForAsset:asset options:options resultHandler:^(NSData *imageData, NSString *dataUTI, UIImageOrientation orientation, NSDictionary *info) {
-                
-                [imageData writeToFile:[NSString stringWithFormat:@"%@/%@", directoryUser, fileName] options:NSDataWritingAtomic error:&error];
-                
-                if (error) {
-                    
-                    // Delete record on Table Auto Upload
-                    if ([selector isEqualToString:selectorUploadAutoUpload] || [selector isEqualToString:selectorUploadAutoUploadAll])
-                        [[NCManageDatabase sharedInstance] deleteAutoUploadWithAssetLocalIdentifier:assetLocalIdentifier];
-                    
-                    // Activity
-                    [[NCManageDatabase sharedInstance] addActivityClient:fileName fileID:assetLocalIdentifier action:k_activityDebugActionUpload selector:selector note:[NSString stringWithFormat:@"%@ [%@]",NSLocalizedString(@"_read_file_error_", nil), error.description] type:k_activityTypeFailure verbose:k_activityVerboseDefault  activeUrl:activeUrl];
-                    
-                    // Error for uploadFileFailure
-                    dispatch_async(dispatch_get_main_queue(), ^{
-                        if (delegate)
-                            if ([delegate respondsToSelector:@selector(uploadFileFailure:fileID:serverUrl:selector:message:errorCode:)])
-                                [delegate uploadFileFailure:nil fileID:nil serverUrl:serverUrl selector:selector message:@"_read_file_error_" errorCode:[NSError errorWithDomain:@"it.twsweb.cryptocloud" code:kCFURLErrorFileDoesNotExist userInfo:nil].code];
-                    });
-                    
-                } else {
-                    
-                    //OK selectorUploadAutoUpload
-                    if ([selector isEqualToString:selectorUploadAutoUpload]) {
-                        if ([self.delegate respondsToSelector:@selector(addDatabaseAutoUpload:asset:)])
-                            [self.delegate addDatabaseAutoUpload:metadataNet asset:asset];
-                    } else {
-                        if ([self.delegate respondsToSelector:@selector(upload:serverUrl:cryptated:template:onlyPlist:fileNameTemplate:assetLocalIdentifier:session:taskStatus:selector:selectorPost:errorCode:delegate:)])
-                            [self.delegate upload:fileName serverUrl:serverUrl cryptated:cryptated template:NO onlyPlist:NO fileNameTemplate:nil assetLocalIdentifier:assetLocalIdentifier session:session taskStatus:taskStatus selector:selector selectorPost:selectorPost errorCode:errorCode delegate:delegate];
-                    }
-                }
-                
-                dispatch_semaphore_signal(semaphoreGroup);
-            }];
-            
-            while (dispatch_semaphore_wait(semaphoreGroup, DISPATCH_TIME_NOW))
-                [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]];
-        }
-    }
-}
-
-@end