Example #1
0
        }// method

        /// <summary>
        /// Parses string to FileStruct
        /// </summary>
        /// <param name="ftpRecord">String including information of file/directory</param>
        /// <returns>FileStruct</returns>
        public FileStruct Parse(string ftpRecord)
        {
            FileStruct    f = new FileStruct();
            FileListStyle _directoryListStyle = GuessFileListStyle(ftpRecord);

            if (_directoryListStyle != FileListStyle.Unknown && ftpRecord != "")
            {
                f.Name = "..";
                switch (_directoryListStyle)
                {
                case FileListStyle.UnixStyle:
                    f = ParseFileStructFromUnixStyleRecord(ftpRecord);
                    break;

                case FileListStyle.WindowsStyle:
                    f = ParseFileStructFromWindowsStyleRecord(ftpRecord);
                    break;
                } //switch
            }     //if
            return(f);
        }         //