Show Date in index confirmation, add new hash logic to all paths, fix hash empty when using folder watch #GI-12

This commit is contained in:
Jonathan Jenne
2021-05-04 12:22:38 +02:00
parent 0692d4e295
commit d771895b43
4 changed files with 118 additions and 52 deletions

View File

@@ -122,7 +122,7 @@ Public Class ClassFolderWatcher
End If
End If
If FolderWatcher_SCAN Is Nothing Then
FolderWatcher_SCAN = New System.IO.FileSystemWatcher(CURRENT_SCAN_FOLDERWATCH, "*.*")
FolderWatcher_SCAN = New FileSystemWatcher(CURRENT_SCAN_FOLDERWATCH, "*.*")
LOGGER.Info(" >> FolderWatch Scan Gestartet")
FolderWatcher_SCAN.IncludeSubdirectories = False
FolderWatcher_SCAN.EnableRaisingEvents = True
@@ -134,7 +134,7 @@ Public Class ClassFolderWatcher
If FolderWatcher_SCAN.EnableRaisingEvents = False Then
' Dim watcher As New FileSystemWatcher()
' watcher.Path = CURRENT_FOLDERWATCH
FolderWatcher_SCAN = New System.IO.FileSystemWatcher(CURRENT_SCAN_FOLDERWATCH, "*.*")
FolderWatcher_SCAN = New FileSystemWatcher(CURRENT_SCAN_FOLDERWATCH, "*.*")
LOGGER.Info(" >> FolderWatch Scan Gestartet")
FolderWatcher_SCAN.IncludeSubdirectories = False
FolderWatcher_SCAN.EnableRaisingEvents = True
@@ -185,18 +185,32 @@ Public Class ClassFolderWatcher
End If
Next
Dim handleType As String
Dim oHandleType As String
If e.FullPath.ToLower.EndsWith(".msg") Then
handleType = "|FW_OUTLOOK_MESSAGE|"
oHandleType = "|FW_OUTLOOK_MESSAGE|"
Else
handleType = "|FW_SIMPLEINDEXER|"
oHandleType = "|FW_SIMPLEINDEXER|"
End If
'Die Datei übergeben
LOGGER.Info(">> OnCreated-File:" & e.FullPath)
If ClassIndexFunctions.FileExistsinDropTable(e.FullPath) = False Then
ClassFilehandle.Decide_FileHandle(e.FullPath, handleType)
Dim oFileExists As Date = ClassIndexFunctions.FileExistsinDropTable(e.FullPath)
If IsNothing(oFileExists) Then
ClassFilehandle.Decide_FileHandle(e.FullPath, oHandleType)
Else
LOGGER.Info(">> Folderwatcher: File already exists:" & e.FullPath)
Dim oResult As DialogResult
Dim oDate As String = oFileExists.ToString("d")
If USER_LANGUAGE = "de-DE" Then
oResult = MsgBox($"Die Datei wurde bereits am [{oDate}] verarbeitet. Wollen Sie die gleiche Datei noch einmal verarbeiten?", MsgBoxStyle.Question Or MsgBoxStyle.YesNo, "GLOBIX - FolderWatch")
Else
oResult = MsgBox($"This file has already been processed at [{oDate}]. Do you want to process the same file again?", MsgBoxStyle.Question Or MsgBoxStyle.YesNo, "GLOBIX - FolderWatch")
End If
If oResult = DialogResult.Yes Then
ClassFilehandle.Decide_FileHandle(e.FullPath, oHandleType)
End If
End If
Catch ex As Exception