Exemplo n.º 1
0
        public List <CloudFile> ReadAll(string user, string path)
        {
            List <CloudFile> buffer = new List <CloudFile>();

            if (!Cache.TryGetValue(user, out CloudInfoFile file))
            {
                file = new CloudInfoFile
                       (
                    RootPath + "\\" + user + ".json"
                       );
                Cache.TryAdd(user, file);
            }

            string[]      paths        = path.Split('\\');
            List <string> actuall_path = new List <string>();

            for (int i = 1; i < paths.Length - 1; ++i)
            {
                actuall_path.Add(paths[i]);
            }
            buffer.AddRange(file.GetFiles(actuall_path.ToArray()));
            buffer.AddRange(file.GetDirs(actuall_path.ToArray()));

            return(buffer);
        }
Exemplo n.º 2
0
        public void DelDir(string user, string path, string name)
        {
            if (!Cache.TryGetValue(user, out CloudInfoFile file))
            {
                file = new CloudInfoFile
                       (
                    RootPath + "\\" + user + ".json"
                       );
                Cache.TryAdd(user, file);
            }

            string[] paths = path.Split('\\');
            file.DelDir(paths, name);
        }