Example #1
0
        private string GetBackupPath(string categoryId, string pageId)
        {
            pageId = PathUtil.SafePath(pageId);

            string path;

            if (Categories.ContainsKey(categoryId))
            {
                if (ParentMap.ContainsKey(categoryId))
                {
                    string parentId = ParentMap[categoryId];

                    if (Categories.ContainsKey(parentId))
                    {
                        path = Path.Combine(Root,
                                            Categories[parentId], Categories[categoryId],
                                            pageId);
                    }
                    else
                    {
                        path = Path.Combine(Root,
                                            "ts_고아", Categories[categoryId],
                                            pageId);
                    }
                }
                else
                {
                    path = Path.Combine(Root, Categories[categoryId], pageId);
                }
            }
            else
            {
                path = Path.Combine(Root, "ts_미분류", pageId);
            }

            if (Directory.Exists(path) == false)
            {
                Directory.CreateDirectory(path);
            }

            return(path);
        }