예제 #1
0
        private bool CheckFile(string filePath)
        {
            bool          result    = true;
            FileValidator validator = new FileValidator();

            if (!validator.DoesFileExist(filePath))
            {
                UI.ConsoleOutPut(StringConstants.FILE_NOT_FOUND);
                result = false;
            }

            else if (!validator.CheckFileType(filePath, ".txt"))
            {
                UI.ConsoleOutPut(StringConstants.WRONG_FILE_TYPE);
                result = false;
            }

            else if (validator.IsFileEmpty(filePath))
            {
                UI.ConsoleOutPut(StringConstants.EMPTY_FILE);
                result = false;
            }

            return(result);
        }