Esempio n. 1
0
        private string GetTarget(IDictionary <string, MappedPath> mappedPaths, string domain, string path)
        {
            MappedPath pathMap = domain != null && mappedPaths.ContainsKey(domain)
                                     ? mappedPaths[domain]
                                     : mappedPaths[string.Empty].AppendDomain(domain);

            return(pathMap.Path + path.Replace('/', '\\').TrimEnd('\\'));
        }
Esempio n. 2
0
        private string GetTarget(string path, string domain, bool bOverwriteCheck)
        {
            MappedPath pathMap = GetPath(domain);
            //Build Dir
            string target = pathMap.Path + path.Replace('/', '\\').TrimEnd('\\');

            ValidatePath(target);
            if (!pathMap.Overwrite && bOverwriteCheck)
            {
                //Check existing file
                if (File.Exists(target))
                {
                    throw new ArgumentException("can't overwrite existing file");
                }
            }
            return(target);
        }
Esempio n. 3
0
        private string GetTarget(string path, string domain, bool bOverwriteCheck)
        {
            MappedPath pathMap = GetPath(domain);
            //Build Dir
            string target = pathMap.Path + PathUtils.Normalize(path);

            ValidatePath(target);
            if (!pathMap.Overwrite && bOverwriteCheck)
            {
                //Check existing file
                if (File.Exists(target))
                {
                    throw new ArgumentException("can't overwrite existing file");
                }
            }
            return(target);
        }