Ejemplo n.º 1
0
        public static String DecodePath(String path, HttpServerUtilityBase server)
        {
            if (String.IsNullOrEmpty(path) || path == "/")
            {
                path = UtilityOperations.GetDockerRootPath(server);
            }
            String decodePath = Models.FileModel.Decode(path);

            return(decodePath);
        }
Ejemplo n.º 2
0
        public void InsertNewUserFolder(HttpServerUtilityBase server, String userName)
        {
            String virtualPath = UtilityOperations.GetDockerRootPath();
            String decodePath  = UtilityOperations.DecodePath(UtilityOperations.GetServerMapPath(virtualPath), server);
            String folderPath  = System.IO.Path.Combine(decodePath, userName);

            if (folderPath != "\\")
            {
                if (!System.IO.Directory.Exists(folderPath))
                {
                    InsertNewFolder(virtualPath, folderPath, userName, userName);
                }
            }
        }
Ejemplo n.º 3
0
        public IList <FileModel> FilterBasedOnAuthorizationsAndPopulateNiceNameAndDescription(IList <FileModel> files, IList <File> filelist)
        {
            IList <FileModel> resultantfiles = new List <FileModel>();
            List <String>     virttualPaths  = new List <String>();

            foreach (var item in files)
            {
                String      virtualPath  = UtilityOperations.GetVirtualPath(item.FullPath);
                List <File> tempfilelist = filelist.Where(x => x.VirtualPath == virtualPath).ToList();
                if (tempfilelist.Count != 0)
                {
                    item.NiceNameOrAreaName = tempfilelist[0].NiceNameOrAreaName;
                    item.Description        = tempfilelist[0].Description;
                    resultantfiles.Add(item);
                }
            }
            return(resultantfiles);
        }
Ejemplo n.º 4
0
        public void PopulateNiceNameAndDescription(IList <FileModel> files)
        {
            List <String> virtualPaths = new List <String>();

            foreach (var item in files)
            {
                virtualPaths.Add(UtilityOperations.GetVirtualPath(item.FullPath));
            }
            DocumentsOperations documentsOperations = new DocumentsOperations();
            List <File>         filelist            = documentsOperations.GetFilesByVirtualPaths(virtualPaths);

            foreach (var item in files)
            {
                List <File> tempfilelist = filelist.Where(x => x.Name == item.Name).ToList();
                if (tempfilelist.Count != 0)
                {
                    item.NiceNameOrAreaName = tempfilelist[0].NiceNameOrAreaName;
                    item.Description        = tempfilelist[0].Description;
                }
            }
        }