Adalennis opened a new issue, #9263:
URL: https://github.com/apache/hop/issues/9263

   ### Apache Hop version?
   
   2.21.0-SNAPSHOT
   
   ### Java version?
   
   Java 21
   
   ### Operating system
   
   macOS
   
   ### What happened?
   
   Found while documenting the result of these actions (#8970, PR #9000). 
Tested with hop-run and checked against the code on main.
   
   **1. Copy files: a file copied into a folder ignores Replace existing files, 
Remove source files and Add files to result files name**
   
   When the source is a file and the destination a folder (Destination is a 
file unchecked), `ActionCopyFiles.processFileFolder()` calls 
`copyFileWithByteTracking()` directly. Unlike `copyOneFileToFile()`, that path 
doesn't check whether the target exists and doesn't register the file for 
removal or for the result. With one file copied into a folder, the action is 
true and:
   
   - with *Replace existing files* unchecked, an existing file with the same 
name in the folder is overwritten;
   - with *Remove source files* checked, the source file is kept;
   - with *Add files to result files name* checked, no result file is added.
   
   A folder copied into a folder handles all three.
   
   **2. Copy files: a file that fails inside a folder is only logged**
   
   `TextFileSelector.copyPendingFiles()` catches the exception of each file and 
only logs it, so `processFileFolder()` still returns true. A source folder with 
a readable and an unreadable file gives true with 0 errors: the readable file 
is copied, and the log shows "Can not copy file/folder [...locked.txt]". The 
workflow follows the success hop as if every file had been copied.
   
   **3. Simple evaluation: an invalid regular expression stops the workflow**
   
   With *Success condition* *If value valid regex* and a value to compare that 
isn't a valid regular expression (for example `([`), 
`ActionSimpleEval.execute()` calls `Pattern.compile()` outside a try. The 
`PatternSyntaxException` leaves the action, the workflow stops, and neither the 
success nor the failure hop is followed:
   
       ERROR: java.util.regex.PatternSyntaxException: Unclosed character class 
near index 1
   
   Expected: the action is false with 1 error, as it is for a value that can't 
be parsed as a number.
   
   
   ### Issue Priority
   
   Priority: 3
   
   ### Issue Component
   
   Component: Hop Gui, Component: Actions


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to