public void CreateFile(string name, string path, string fileType, string tmpCreationPath, long size)
        {
            var file   = new FileObj(name, path, fileType, size);
            var parent = _folderContentFolderService.GetParentFolder(file);

            //Validate that the file is unique in all pages. If the file is unique then save it
            _folderContentPageService.ValidateUniquenessOnAllFolderPages(parent, file);
            _folderContentFileRepository.CreateOrUpdateFolderContentFile(name, path, file);

            _folderContentFileRepository.Move(name, path, tmpCreationPath);
            _folderContentFolderService.UpdateNextPageToWrite(parent);
            _folderContentPageService.AddToFolderPage(parent, parent.NextPhysicalPageToWrite, file);
        }
Esempio n. 2
0
        public void CreateFolder(string name, string path)
        {
            name = name.ToLower();
            path = path.ToLower();
            if (!string.IsNullOrEmpty(path) && path.ToCharArray().Last() == '/')
            {
                var listOfChars = path.ToCharArray().ToList();
                listOfChars.RemoveAt(listOfChars.Count - 1);
                path = new string(listOfChars.ToArray());
            }
            ValidatePath(name, path);
            IFolder newFolder = new FolderObj(name, path, _constance.DefaultNumberOfElementOnPage);
            var     parent    = GetParentFolder(newFolder);

            _folderContentPageService.ValidateUniquenessOnAllFolderPages(parent, newFolder);
            CreateFolder(newFolder);
        }