clean up files properly
This commit is contained in:
parent
d036ad00c2
commit
09f1684d81
@ -42,6 +42,19 @@ Public Class ClassFileHandler
|
|||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Public Sub Clear_Tempfiles()
|
||||||
|
For Each oFile In TempFiles
|
||||||
|
Try
|
||||||
|
System.IO.File.Delete(oFile)
|
||||||
|
Catch ex As Exception
|
||||||
|
Logger.Error(ex)
|
||||||
|
End Try
|
||||||
|
Next
|
||||||
|
|
||||||
|
TempFiles.Clear()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
Public Function Decide_FileHandle(pFilepath As String, pHandletype As String) As Boolean
|
Public Function Decide_FileHandle(pFilepath As String, pHandletype As String) As Boolean
|
||||||
Try
|
Try
|
||||||
''TODO: Before doing anything, clean the filename
|
''TODO: Before doing anything, clean the filename
|
||||||
|
|||||||
@ -269,7 +269,7 @@ Public Class frmStart
|
|||||||
If IO.File.Exists(CURRENT_WORKFILE) = True And DTACTUAL_FILES.Rows.Count > 0 Then
|
If IO.File.Exists(CURRENT_WORKFILE) = True And DTACTUAL_FILES.Rows.Count > 0 Then
|
||||||
Open_IndexDialog()
|
Open_IndexDialog()
|
||||||
Else
|
Else
|
||||||
Throw New FileNotFoundException("Dropped file does not exist anymore!")
|
LOGGER.Warn("Trying to index non-existent file [{0}]", CURRENT_WORKFILE)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
' If multi-indexing is active, all files have been indexed by now, so we can leave the loop
|
' If multi-indexing is active, all files have been indexed by now, so we can leave the loop
|
||||||
@ -285,7 +285,7 @@ Public Class frmStart
|
|||||||
|
|
||||||
Finally
|
Finally
|
||||||
' Clear all temp files after indexing
|
' Clear all temp files after indexing
|
||||||
Clear_Tempfiles()
|
FILE_HANDLER.Clear_Tempfiles()
|
||||||
EMAIL.Clear_TempFiles()
|
EMAIL.Clear_TempFiles()
|
||||||
FileDrop.RemoveTempDirectory()
|
FileDrop.RemoveTempDirectory()
|
||||||
|
|
||||||
@ -565,17 +565,6 @@ Public Class frmStart
|
|||||||
End Sub
|
End Sub
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
Private Sub Clear_Tempfiles()
|
|
||||||
'TempDateien löschen
|
|
||||||
For Each oFile In FILE_HANDLER.TempFiles
|
|
||||||
Try
|
|
||||||
System.IO.File.Delete(oFile)
|
|
||||||
Catch ex As Exception
|
|
||||||
LOGGER.Error(ex)
|
|
||||||
End Try
|
|
||||||
Next
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Sub Open_IndexDialog()
|
Sub Open_IndexDialog()
|
||||||
Try
|
Try
|
||||||
Hide()
|
Hide()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user