Exemplo n.º 1
0
        public static async Task <bool> AddNewestXmlFileWithExtensionToList(
            ContentURI uri, string docPath,
            string fileExtension, IDictionary <string, string> lstFilePaths)
        {
            bool          bHasCompleted = false;
            DirectoryInfo dir           = null;

            if (!FileStorageIO.DirectoryExists(uri, docPath))
            {
                uri.ErrorMessage = Exceptions.DevTreksErrors.MakeStandardErrorMsg(
                    string.Empty, "DIRECTORY_NOEXIST");
                return(bHasCompleted);
            }
            if (Path.HasExtension(docPath))
            {
                //if it has an extension it needs the parent directory
                dir = new DirectoryInfo(
                    Path.GetDirectoryName(docPath));
            }
            else
            {
                dir = new DirectoryInfo(docPath);
            }
            bHasCompleted = await AddNewestFileWithFileExtension(uri, dir, fileExtension,
                                                                 lstFilePaths);

            bHasCompleted = true;
            return(bHasCompleted);
        }
Exemplo n.º 2
0
        public static void AddNewestXmlFileWithExtensionToList(
            ContentURI uri, string docPath,
            string fileExtension, IDictionary <string, string> lstFilePaths,
            ref string errorMsg)
        {
            DirectoryInfo dir = null;

            if (!FileStorageIO.DirectoryExists(uri, docPath))
            {
                errorMsg = Exceptions.DevTreksErrors.MakeStandardErrorMsg(
                    string.Empty, "DIRECTORY_NOEXIST");
                return;
            }
            if (Path.HasExtension(docPath))
            {
                //if it has an extension it needs the parent directory
                dir = new DirectoryInfo(
                    Path.GetDirectoryName(docPath));
            }
            else
            {
                dir = new DirectoryInfo(docPath);
            }
            AddNewestFileWithFileExtension(uri, dir, fileExtension,
                                           lstFilePaths);
        }