コード例 #1
0
        public string GetHttpHomePath()
        {
            NameParser parser = new NameParser(NameParserType.URL);

            HttpHomePath = FTPHelpers.RemovePrefixes(HttpHomePath.Replace("%host", LocalhostRoot));
            return(parser.Parse(HttpHomePath));
        }
コード例 #2
0
ファイル: FTPAccount.cs プロジェクト: Z1ni/ShareX
        public string GetHttpHomePath()
        {
            HttpHomePath = FTPHelpers.RemovePrefixes(HttpHomePath);
            NameParser nameParser = new NameParser(NameParserType.URL);

            return(nameParser.Parse(HttpHomePath.Replace("%host", Host)));
        }
コード例 #3
0
ファイル: FTPAccount.cs プロジェクト: yoykiee/ShareX
        public string GetUriPath(string filename)
        {
            if (string.IsNullOrEmpty(Host))
            {
                return(string.Empty);
            }

            if (HttpHomePathNoExtension)
            {
                filename = Path.GetFileNameWithoutExtension(filename);
            }

            string path;

            HttpHomePath = FTPHelpers.RemovePrefixes(HttpHomePath);
            NameParser nameParser   = new NameParser(NameParserType.URL);
            string     httpHomePath = nameParser.Parse(HttpHomePath.Replace("%host", Host));

            string subFolderPath   = GetSubFolderPath();
            string browserProtocol = BrowserProtocol.GetDescription();

            if (string.IsNullOrEmpty(httpHomePath))
            {
                string host = Host;

                if (host.StartsWith("ftp."))
                {
                    host = host.Substring(4);
                }

                path = Helpers.CombineURL(host, subFolderPath, filename);
            }
            else
            {
                if (!httpHomePath.StartsWith("@"))
                {
                    path = Helpers.CombineURL(httpHomePath, subFolderPath);
                }
                else
                {
                    path = httpHomePath.Substring(1);
                }

                if (path.EndsWith("="))
                {
                    path += filename;
                }
                else
                {
                    path = Helpers.CombineURL(path, filename);
                }
            }

            if (!path.StartsWith(browserProtocol))
            {
                path = browserProtocol + path;
            }

            return(path);
        }
コード例 #4
0
        public string GetHttpHomePath()
        {
            // @ deprecated
            if (HttpHomePath.StartsWith("@"))
            {
                HttpHomePath = HttpHomePath.Substring(1);
                HttpHomePathAutoAddSubFolderPath = false;
            }

            HttpHomePath = FTPHelpers.RemovePrefixes(HttpHomePath);

            NameParser nameParser = new NameParser(NameParserType.URL);

            return(nameParser.Parse(HttpHomePath.Replace("%host", Host)));
        }