23-12-2022
This commit is contained in:
@@ -3,6 +3,7 @@ Imports Quartz
|
||||
Imports System.Text.RegularExpressions
|
||||
Imports DigitalData.Modules.Filesystem
|
||||
Imports ECM.JobRunner.Common
|
||||
Imports FxResources.System
|
||||
|
||||
Namespace Scheduler.Jobs
|
||||
|
||||
@@ -176,11 +177,28 @@ Namespace Scheduler.Jobs
|
||||
'Check if target folder exists
|
||||
If Windream.TestFolderExists(pProfile.TargetFolder) = False Then
|
||||
If Windream.NewFolder(pProfile.TargetFolder) = False Then
|
||||
Logger.Warn("Folder [{0}] could not be created!", pProfile.TargetFolder)
|
||||
Logger.Warn("Folder [{0}] could not be created! Exiting.", pProfile.TargetFolder)
|
||||
Return Nothing
|
||||
End If
|
||||
End If
|
||||
|
||||
Dim oFinalDirectoryPath = pProfile.TargetFolder
|
||||
|
||||
If pProfile.SubfolderDateFormat <> String.Empty Then
|
||||
' ToString formatter needs the backslashes escaped again.
|
||||
Dim oSubfolders = Now.ToString(pProfile.SubfolderDateFormat.Replace())
|
||||
Dim oFullPath = IO.Path.Combine(pProfile.TargetFolder, oSubfolders)
|
||||
|
||||
Logger.Debug("Creating subfolder [{0}] in Target path [{1}]", oSubfolders, pProfile.TargetFolder)
|
||||
|
||||
If Windream.NewFolder(oFullPath) = False Then
|
||||
Logger.Warn("Folder [{0}] could not be created! Exiting.", oFullPath)
|
||||
Return Nothing
|
||||
End If
|
||||
|
||||
oFinalDirectoryPath = oFullPath
|
||||
End If
|
||||
|
||||
' Generate new filepath and stream file
|
||||
Dim oFileName = IO.Path.GetFileName(pFile.FilePath)
|
||||
Dim oNewFilePath As String = IO.Path.Combine(pProfile.TargetFolder, oFileName)
|
||||
|
||||
Reference in New Issue
Block a user