예제 #1
0
        private void ParseMessageBody()
        {
            m_Items = new List <FtpItem>();

            var listingItems = MessageBody.Split(new[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);

            foreach (var listingItem in listingItems)
            {
                FtpItem ftpItem;

                if (TryParseDosList(listingItem, out ftpItem) || TryParseMachineList(listingItem, out ftpItem) || TryParseUnixList(listingItem, Features, out ftpItem) || TryParseVaxList(listingItem, out ftpItem))
                {
                    // TODO: we need to be careful about the slashes in the path name
                    ftpItem.FullName = Request.Arguments[0].GetFtpPath(ftpItem.Name);
                    m_Items.Add(ftpItem);
                }
            }
        }
예제 #2
0
        public void ParseArguments()
        {
            Arguments.Clear();

            foreach (string arg in MessageBody.Split('&'))
            {
                if (arg.Length == 0)
                {
                    continue;
                }


                string[] keyValue = arg.Split('=');
                if (keyValue.Length != 2)
                {
                    throw new AegisException(AegisResult.InvalidArgument);
                }


                Arguments[keyValue[0]] = keyValue[1];
            }
        }