示例#1
0
        public virtual void Publish(ExportDeploymentContext context, ExportDeployment deployment)
        {
            var destinationFolder = deployment.GetDeploymentFolder(true);

            if (destinationFolder.IsEmpty())
            {
                return;
            }

            if (!System.IO.Directory.Exists(destinationFolder))
            {
                System.IO.Directory.CreateDirectory(destinationFolder);
            }

            if (context.CreateZipArchive)
            {
                if (File.Exists(context.ZipPath))
                {
                    var destinationFile = Path.Combine(destinationFolder, Path.GetFileName(context.ZipPath));

                    File.Copy(context.ZipPath, destinationFile, true);

                    context.Log.Information("Copied zipped export data to " + destinationFile);
                }
            }
            else
            {
                if (!FileSystemHelper.CopyDirectory(new DirectoryInfo(context.FolderContent), new DirectoryInfo(destinationFolder)))
                {
                    context.Result.LastError = context.T("Admin.DataExchange.Export.Deployment.CopyFileFailed");
                }

                context.Log.Information("Copied export data files to " + destinationFolder);
            }
        }
        public virtual void Publish(ExportDeploymentContext context, ExportDeployment deployment)
        {
            var destinationFolder = deployment.GetDeploymentFolder(true);

            if (destinationFolder.IsEmpty())
                return;

            if (!System.IO.Directory.Exists(destinationFolder))
            {
                System.IO.Directory.CreateDirectory(destinationFolder);
            }

            if (context.CreateZipArchive)
            {
                if (File.Exists(context.ZipPath))
                {
                    var destinationFile = Path.Combine(destinationFolder, Path.GetFileName(context.ZipPath));

                    File.Copy(context.ZipPath, destinationFile, true);

                    context.Log.Information("Copied zipped export data to " + destinationFile);
                }
            }
            else
            {
                if (!FileSystemHelper.CopyDirectory(new DirectoryInfo(context.FolderContent), new DirectoryInfo(destinationFolder)))
                {
                    context.Result.LastError = context.T("Admin.DataExchange.Export.Deployment.CopyFileFailed");
                }

                context.Log.Information("Copied export data files to " + destinationFolder);
            }
        }
        public virtual void Publish(ExportDeploymentContext context, ExportDeployment deployment)
        {
            var targetFolder = deployment.GetDeploymentFolder(true);

            if (!FileSystemHelper.CopyDirectory(new DirectoryInfo(context.FolderContent), new DirectoryInfo(targetFolder)))
            {
                context.Result.LastError = context.T("Admin.DataExchange.Export.Deployment.CopyFileFailed");
            }

            context.Log.Information("Copied export data files to " + targetFolder);
        }
示例#4
0
        public virtual void Publish(ExportDeploymentContext context, ExportDeployment deployment)
        {
            var targetFolder = deployment.GetDeploymentFolder(true);

            if (!FileSystemHelper.CopyDirectory(new DirectoryInfo(context.FolderContent), new DirectoryInfo(targetFolder)))
            {
                context.Result.LastError = context.T("Admin.DataExchange.Export.Deployment.CopyFileFailed");
            }

            context.Log.Information("Copied export data files to " + targetFolder);
        }