Beispiel #1
0
        internal async Task ImportResourcesAsync(string resourceDocumentFilePath, string baseFilePath)
        {
            var importer = new ResourceImporter(_config, _httpClient);

            await ExecuteWithinLockAsync(
                () =>
                importer.ImportResources(resourceDocumentFilePath, baseFilePath), $"Failed to import resource file {resourceDocumentFilePath} to Episerver."
                );
        }
        internal void ImportResources(string resourceDocumentFilePath, string baseFilePath)
        {
            lock (EpiLockObject.Instance)
            {
                try
                {
                    var importer = new ResourceImporter(_config, _httpClient);
                    importer.ImportResources(resourceDocumentFilePath, baseFilePath);

                    IntegrationLogger.Write(LogLevel.Information, $"Resource file {resourceDocumentFilePath} imported to Episerver.");
                }
                catch (Exception exception)
                {
                    IntegrationLogger.Write(LogLevel.Error, $"Failed to import resource file {resourceDocumentFilePath} to Episerver.", exception);
                    throw;
                }
            }
        }