Mike, what about giving it another name then like REAL_FILE_VALIDATOR? It's not perfect, but it draws from the distinction between real (proper) files on the one, and symlinks, dirs etc in the other side, like many apis use it. I'm not quite sure, what do you think? Best, Lars
On 28 November 2020 16:37:41 CET, Mike Thomsen <mikerthom...@gmail.com> wrote: >Nissim, > >If I had to guess, it was an oversight that it handles both folders >and files. Any refactored version would have to not change the current >default behavior. So, what I'd suggest would be a second constructor >that allows you to set a boolean flag to put in a "file-only" mode and >then add another validator that checks for the existence of a folder >and that it is a folder, not a file. > >Thanks, > >Mike > >On Thu, Nov 19, 2020 at 1:06 PM Nissim Shiman ><nshi...@yahoo.com.invalid> wrote: >> >> Hello Nifi devs, >> It has been noticed that the StandardValidators.FILE_EXISTS_VALIDATOR >[1] verifies that a value exists, but it does not verify that it is a >file, as opposed to being a directory [2] >> >> Is this by design or is it worthy of a bug fix? >> >> >> [1] >https://github.com/apache/nifi/blob/main/nifi-commons/nifi-utils/src/main/java/org/apache/nifi/processor/util/StandardValidators.java#L505[2] >https://github.com/apache/nifi/blob/main/nifi-commons/nifi-utils/src/main/java/org/apache/nifi/processor/util/StandardValidators.java#L851-L852 >> >> Thanks, >> Nissim Shiman