This is an automated email from the ASF dual-hosted git repository.

hansva pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/hop.git


The following commit(s) were added to refs/heads/main by this push:
     new cd89d0c439 #7166 (#7169)
cd89d0c439 is described below

commit cd89d0c4390aed8f2d0ce209ab2b29b9136e2d2c
Author: Bart Maertens <[email protected]>
AuthorDate: Tue May 26 07:29:05 2026 +0000

    #7166 (#7169)
    
    * fix for required files and subfolders. fixes #7166
    
    * added missing ASF header. fixes #7166
    
    * fixed category for JSON Normalize Input transform. fixes #7170
---
 .../org/apache/hop/core/fileinput/InputFile.java   |   2 +-
 .../transforms/file/BaseFileInputMeta.java         |   3 +
 .../0100-json-input-include-subfolders.hpl         | 170 +++++++++++++++++
 ...100-json-normalize-input-include-subfolders.hpl | 187 +++++++++++++++++++
 .../0100-load-file-content-include-subfolders.hpl  | 163 +++++++++++++++++
 .../0100-text-file-input-include-subfolders.hpl    | 202 +++++++++++++++++++++
 .../golden-json-input-include-subfolders.csv       |   3 +
 ...den-json-normalize-input-include-subfolders.csv |   3 +
 ...golden-load-file-content-include-subfolders.csv |   3 +
 .../golden-text-file-input-include-subfolders.csv  |   3 +
 .../file-input-include-subfolders/root-events.json |   1 +
 .../files/file-input-include-subfolders/root.json  |   1 +
 .../files/file-input-include-subfolders/root.txt   |   2 +
 .../sub/nested-events.json                         |   1 +
 .../file-input-include-subfolders/sub/nested.json  |   1 +
 .../file-input-include-subfolders/sub/nested.txt   |   2 +
 .../main-0100-file-input-include-subfolders.hwf    |  89 +++++++++
 .../golden-json-input-include-subfolders.json      |  16 ++
 ...en-json-normalize-input-include-subfolders.json |  24 +++
 ...olden-load-file-content-include-subfolders.json |  16 ++
 .../golden-text-file-input-include-subfolders.json |  16 ++
 .../0100-json-input-include-subfolders UNIT.json   |  28 +++
 ...on-normalize-input-include-subfolders UNIT.json |  33 ++++
 ...-load-file-content-include-subfolders UNIT.json |  28 +++
 ...00-text-file-input-include-subfolders UNIT.json |  28 +++
 .../jsonnormalize/JsonNormalizeInputMeta.java      |   2 +-
 .../jsoninput/JsonInputMetaFileFlagsTest.java      |  93 ++++++++++
 .../loadfileinput/LoadFileInputDialog.java         |   2 +-
 28 files changed, 1119 insertions(+), 3 deletions(-)

diff --git a/core/src/main/java/org/apache/hop/core/fileinput/InputFile.java 
b/core/src/main/java/org/apache/hop/core/fileinput/InputFile.java
index ed8c994c75..383225cc7f 100644
--- a/core/src/main/java/org/apache/hop/core/fileinput/InputFile.java
+++ b/core/src/main/java/org/apache/hop/core/fileinput/InputFile.java
@@ -87,7 +87,7 @@ public class InputFile {
   }
 
   public String getIncludeSubFoldersDesc() {
-    if (fileRequired) {
+    if (includeSubFolders) {
       return BaseMessages.getString("System.Combo.Yes");
     } else {
       return BaseMessages.getString("System.Combo.No");
diff --git 
a/engine/src/main/java/org/apache/hop/pipeline/transforms/file/BaseFileInputMeta.java
 
b/engine/src/main/java/org/apache/hop/pipeline/transforms/file/BaseFileInputMeta.java
index 843b8c7bb5..487f497d47 100644
--- 
a/engine/src/main/java/org/apache/hop/pipeline/transforms/file/BaseFileInputMeta.java
+++ 
b/engine/src/main/java/org/apache/hop/pipeline/transforms/file/BaseFileInputMeta.java
@@ -131,10 +131,13 @@ public abstract class BaseFileInputMeta<
           XmlHandler.getNodeValue(XmlHandler.getSubNodeByNr(fileNode, 
"exclude_filemask", i));
       String fileRequired =
           XmlHandler.getNodeValue(XmlHandler.getSubNodeByNr(fileNode, 
"file_required", i));
+      String includeSubfolders =
+          XmlHandler.getNodeValue(XmlHandler.getSubNodeByNr(fileNode, 
"include_subfolders", i));
       inputFile.setFileName(fileName);
       inputFile.setFileMask(fileMask);
       inputFile.setExcludeFileMask(fileExcludeMask);
       inputFile.setFileRequired(Const.toBoolean(fileRequired));
+      inputFile.setIncludeSubFolders(Const.toBoolean(includeSubfolders));
       inputFiles.add(inputFile);
     }
   }
diff --git 
a/integration-tests/transforms/0100-json-input-include-subfolders.hpl 
b/integration-tests/transforms/0100-json-input-include-subfolders.hpl
new file mode 100644
index 0000000000..e490335561
--- /dev/null
+++ b/integration-tests/transforms/0100-json-input-include-subfolders.hpl
@@ -0,0 +1,170 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+-->
+<pipeline>
+  <info>
+    <name>0100-json-input-include-subfolders</name>
+    <name_sync_with_filename>Y</name_sync_with_filename>
+    <description>Issue 7166: JSON Input must honor include_subfolders when 
loading legacy file XML.</description>
+    <extended_description/>
+    <pipeline_version/>
+    <pipeline_type>Normal</pipeline_type>
+    <parameters>
+    </parameters>
+    <capture_transform_performance>N</capture_transform_performance>
+    
<transform_performance_capturing_delay>1000</transform_performance_capturing_delay>
+    
<transform_performance_capturing_size_limit>100</transform_performance_capturing_size_limit>
+    <created_user>-</created_user>
+    <created_date>2026/05/25 12:00:00.000</created_date>
+    <modified_user>-</modified_user>
+    <modified_date>2026/05/25 12:00:00.000</modified_date>
+  </info>
+  <notepads>
+  </notepads>
+  <order>
+    <hop>
+      <from>JSON input</from>
+      <to>Sort rows</to>
+      <enabled>Y</enabled>
+    </hop>
+    <hop>
+      <from>Sort rows</from>
+      <to>validate</to>
+      <enabled>Y</enabled>
+    </hop>
+  </order>
+  <transform>
+    <name>JSON input</name>
+    <type>JsonInput</type>
+    <description/>
+    <distribute>Y</distribute>
+    <custom_distribution/>
+    <copies>1</copies>
+    <partitioning>
+      <method>none</method>
+      <schema_name/>
+    </partitioning>
+    <include>N</include>
+    <include_field/>
+    <rownum>N</rownum>
+    <addresultfile>N</addresultfile>
+    <readurl>N</readurl>
+    <removeSourceField>N</removeSourceField>
+    <IsIgnoreEmptyFile>N</IsIgnoreEmptyFile>
+    <doNotFailIfNoFile>Y</doNotFailIfNoFile>
+    <ignoreMissingPath>Y</ignoreMissingPath>
+    <defaultPathLeafToNull>Y</defaultPathLeafToNull>
+    <rownum_field/>
+    <files>
+      <file>
+        <name>${PROJECT_HOME}/files/file-input-include-subfolders</name>
+        <filemask>^[^/]+\.json$</filemask>
+        <exclude_filemask>.*-events\.json$</exclude_filemask>
+        <file_required>N</file_required>
+        <include_subfolders>Y</include_subfolders>
+      </file>
+    </files>
+    <fields>
+      <field>
+        <name>id</name>
+        <path>$.id</path>
+        <type>String</type>
+        <format/>
+        <currency/>
+        <decimal/>
+        <group/>
+        <length>-1</length>
+        <precision>-1</precision>
+        <trim_type>none</trim_type>
+        <repeat>N</repeat>
+      </field>
+    </fields>
+    <limit>0</limit>
+    <IsInFields>N</IsInFields>
+    <IsAFile>N</IsAFile>
+    <valueField/>
+    <shortFileFieldName/>
+    <pathFieldName/>
+    <hiddenFieldName/>
+    <lastModificationTimeFieldName/>
+    <uriNameFieldName/>
+    <rootUriNameFieldName/>
+    <extensionFieldName/>
+    <sizeFieldName/>
+    <attributes/>
+    <GUI>
+      <xloc>80</xloc>
+      <yloc>64</yloc>
+    </GUI>
+  </transform>
+  <transform>
+    <name>Sort rows</name>
+    <type>SortRows</type>
+    <description/>
+    <distribute>Y</distribute>
+    <custom_distribution/>
+    <copies>1</copies>
+    <partitioning>
+      <method>none</method>
+      <schema_name/>
+    </partitioning>
+    <directory>${java.io.tmpdir}</directory>
+    <prefix>out</prefix>
+    <sort_size>1000000</sort_size>
+    <free_memory/>
+    <compress>N</compress>
+    <compress_variable/>
+    <unique_rows>N</unique_rows>
+    <fields>
+      <field>
+        <name>id</name>
+        <ascending>Y</ascending>
+        <case_sensitive>N</case_sensitive>
+        <collator_enabled>N</collator_enabled>
+        <collator_strength>0</collator_strength>
+        <presorted>N</presorted>
+      </field>
+    </fields>
+    <attributes/>
+    <GUI>
+      <xloc>224</xloc>
+      <yloc>64</yloc>
+    </GUI>
+  </transform>
+  <transform>
+    <name>validate</name>
+    <type>Dummy</type>
+    <description/>
+    <distribute>Y</distribute>
+    <custom_distribution/>
+    <copies>1</copies>
+    <partitioning>
+      <method>none</method>
+      <schema_name/>
+    </partitioning>
+    <attributes/>
+    <GUI>
+      <xloc>368</xloc>
+      <yloc>64</yloc>
+    </GUI>
+  </transform>
+  <transform_error_handling>
+  </transform_error_handling>
+  <attributes/>
+</pipeline>
diff --git 
a/integration-tests/transforms/0100-json-normalize-input-include-subfolders.hpl 
b/integration-tests/transforms/0100-json-normalize-input-include-subfolders.hpl
new file mode 100644
index 0000000000..1e3d971a0f
--- /dev/null
+++ 
b/integration-tests/transforms/0100-json-normalize-input-include-subfolders.hpl
@@ -0,0 +1,187 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+-->
+<pipeline>
+  <info>
+    <name>0100-json-normalize-input-include-subfolders</name>
+    <name_sync_with_filename>Y</name_sync_with_filename>
+    <description>Issue 7166: JSON Normalize Input must honor 
include_subfolders when loading legacy file XML.</description>
+    <extended_description/>
+    <pipeline_version/>
+    <pipeline_type>Normal</pipeline_type>
+    <parameters>
+    </parameters>
+    <capture_transform_performance>N</capture_transform_performance>
+    
<transform_performance_capturing_delay>1000</transform_performance_capturing_delay>
+    
<transform_performance_capturing_size_limit>100</transform_performance_capturing_size_limit>
+    <created_user>-</created_user>
+    <created_date>2026/05/25 12:00:00.000</created_date>
+    <modified_user>-</modified_user>
+    <modified_date>2026/05/25 12:00:00.000</modified_date>
+  </info>
+  <notepads>
+  </notepads>
+  <order>
+    <hop>
+      <from>JSON normalize input</from>
+      <to>Sort rows</to>
+      <enabled>Y</enabled>
+    </hop>
+    <hop>
+      <from>Sort rows</from>
+      <to>validate</to>
+      <enabled>Y</enabled>
+    </hop>
+  </order>
+  <transform>
+    <name>JSON normalize input</name>
+    <type>JsonNormalizeInput</type>
+    <description/>
+    <distribute>Y</distribute>
+    <custom_distribution/>
+    <copies>1</copies>
+    <partitioning>
+      <method>none</method>
+      <schema_name/>
+    </partitioning>
+    <include>N</include>
+    <include_field/>
+    <rownum>N</rownum>
+    <rownum_field/>
+    <limit>0</limit>
+    <valueField/>
+    <IsInFields>N</IsInFields>
+    <IsAFile>N</IsAFile>
+    <addresultfile>N</addresultfile>
+    <IsIgnoreEmptyFile>N</IsIgnoreEmptyFile>
+    <doNotFailIfNoFile>Y</doNotFailIfNoFile>
+    <readurl>N</readurl>
+    <removeSourceField>N</removeSourceField>
+    <recordPath>$.events[*]</recordPath>
+    <fieldSeparator>.</fieldSeparator>
+    <maxFlattenDepth>-1</maxFlattenDepth>
+    <arrayHandling>STRINGIFY</arrayHandling>
+    <beyondDepthBehavior>STRINGIFY</beyondDepthBehavior>
+    <ignoreMissingField>Y</ignoreMissingField>
+    <shortFileFieldName/>
+    <extensionFieldName/>
+    <pathFieldName/>
+    <sizeFieldName/>
+    <hiddenFieldName/>
+    <lastModificationTimeFieldName/>
+    <uriNameFieldName/>
+    <rootUriNameFieldName/>
+    <files>
+      <file>
+        <name>${PROJECT_HOME}/files/file-input-include-subfolders</name>
+        <filemask>.*-events\.json$</filemask>
+        <exclude_filemask/>
+        <file_required>N</file_required>
+        <include_subfolders>Y</include_subfolders>
+      </file>
+    </files>
+    <fields>
+      <field>
+        <name>id</name>
+        <path>id</path>
+        <type>String</type>
+        <format/>
+        <trim_type>none</trim_type>
+        <length>-1</length>
+        <precision>-1</precision>
+        <currency/>
+        <decimal/>
+        <group/>
+        <repeat>N</repeat>
+      </field>
+      <field>
+        <name>event</name>
+        <path>event</path>
+        <type>String</type>
+        <format/>
+        <trim_type>none</trim_type>
+        <length>-1</length>
+        <precision>-1</precision>
+        <currency/>
+        <decimal/>
+        <group/>
+        <repeat>N</repeat>
+      </field>
+    </fields>
+    <attributes/>
+    <GUI>
+      <xloc>80</xloc>
+      <yloc>64</yloc>
+    </GUI>
+  </transform>
+  <transform>
+    <name>Sort rows</name>
+    <type>SortRows</type>
+    <description/>
+    <distribute>Y</distribute>
+    <custom_distribution/>
+    <copies>1</copies>
+    <partitioning>
+      <method>none</method>
+      <schema_name/>
+    </partitioning>
+    <directory>${java.io.tmpdir}</directory>
+    <prefix>out</prefix>
+    <sort_size>1000000</sort_size>
+    <free_memory/>
+    <compress>N</compress>
+    <compress_variable/>
+    <unique_rows>N</unique_rows>
+    <fields>
+      <field>
+        <name>id</name>
+        <ascending>Y</ascending>
+        <case_sensitive>N</case_sensitive>
+        <collator_enabled>N</collator_enabled>
+        <collator_strength>0</collator_strength>
+        <presorted>N</presorted>
+      </field>
+    </fields>
+    <attributes/>
+    <GUI>
+      <xloc>224</xloc>
+      <yloc>64</yloc>
+    </GUI>
+  </transform>
+  <transform>
+    <name>validate</name>
+    <type>Dummy</type>
+    <description/>
+    <distribute>Y</distribute>
+    <custom_distribution/>
+    <copies>1</copies>
+    <partitioning>
+      <method>none</method>
+      <schema_name/>
+    </partitioning>
+    <attributes/>
+    <GUI>
+      <xloc>368</xloc>
+      <yloc>64</yloc>
+    </GUI>
+  </transform>
+  <transform_error_handling>
+  </transform_error_handling>
+  <attributes/>
+</pipeline>
diff --git 
a/integration-tests/transforms/0100-load-file-content-include-subfolders.hpl 
b/integration-tests/transforms/0100-load-file-content-include-subfolders.hpl
new file mode 100644
index 0000000000..9ae919cfae
--- /dev/null
+++ b/integration-tests/transforms/0100-load-file-content-include-subfolders.hpl
@@ -0,0 +1,163 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+-->
+<pipeline>
+  <info>
+    <name>0100-load-file-content-include-subfolders</name>
+    <name_sync_with_filename>Y</name_sync_with_filename>
+    <description>Issue 7166: Load file content must honor include_subfolders 
when loading legacy file XML.</description>
+    <extended_description/>
+    <pipeline_version/>
+    <pipeline_type>Normal</pipeline_type>
+    <parameters>
+    </parameters>
+    <capture_transform_performance>N</capture_transform_performance>
+    
<transform_performance_capturing_delay>1000</transform_performance_capturing_delay>
+    
<transform_performance_capturing_size_limit>100</transform_performance_capturing_size_limit>
+    <created_user>-</created_user>
+    <created_date>2026/05/25 12:00:00.000</created_date>
+    <modified_user>-</modified_user>
+    <modified_date>2026/05/25 12:00:00.000</modified_date>
+  </info>
+  <notepads>
+  </notepads>
+  <order>
+    <hop>
+      <from>Load file content</from>
+      <to>Sort rows</to>
+      <enabled>Y</enabled>
+    </hop>
+    <hop>
+      <from>Sort rows</from>
+      <to>validate</to>
+      <enabled>Y</enabled>
+    </hop>
+  </order>
+  <transform>
+    <name>Load file content</name>
+    <type>LoadFileInput</type>
+    <description/>
+    <distribute>Y</distribute>
+    <custom_distribution/>
+    <copies>1</copies>
+    <partitioning>
+      <method>none</method>
+      <schema_name/>
+    </partitioning>
+    <include>N</include>
+    <include_field/>
+    <rownum>N</rownum>
+    <addresultfile>N</addresultfile>
+    <IsIgnoreEmptyFile>N</IsIgnoreEmptyFile>
+    <IsIgnoreMissingPath>N</IsIgnoreMissingPath>
+    <rownum_field/>
+    <encoding>UTF-8</encoding>
+    <file>
+      <name>${PROJECT_HOME}/files/file-input-include-subfolders</name>
+      <filemask>.*\.txt$</filemask>
+      <exclude_filemask/>
+      <file_required>N</file_required>
+      <include_subfolders>Y</include_subfolders>
+    </file>
+    <fields>
+      <field>
+        <name>file_size</name>
+        <element_type>size</element_type>
+        <type>Integer</type>
+        <format/>
+        <currency/>
+        <decimal/>
+        <group/>
+        <length>-1</length>
+        <precision>-1</precision>
+        <trim_type>none</trim_type>
+        <repeat>N</repeat>
+      </field>
+    </fields>
+    <limit>0</limit>
+    <IsInFields>N</IsInFields>
+    <DynamicFilenameField/>
+    <shortFileFieldName>short_file</shortFileFieldName>
+    <pathFieldName/>
+    <hiddenFieldName/>
+    <lastModificationTimeFieldName/>
+    <uriNameFieldName/>
+    <rootUriNameFieldName/>
+    <extensionFieldName/>
+    <attributes/>
+    <GUI>
+      <xloc>80</xloc>
+      <yloc>64</yloc>
+    </GUI>
+  </transform>
+  <transform>
+    <name>Sort rows</name>
+    <type>SortRows</type>
+    <description/>
+    <distribute>Y</distribute>
+    <custom_distribution/>
+    <copies>1</copies>
+    <partitioning>
+      <method>none</method>
+      <schema_name/>
+    </partitioning>
+    <directory>${java.io.tmpdir}</directory>
+    <prefix>out</prefix>
+    <sort_size>1000000</sort_size>
+    <free_memory/>
+    <compress>N</compress>
+    <compress_variable/>
+    <unique_rows>N</unique_rows>
+    <fields>
+      <field>
+        <name>short_file</name>
+        <ascending>Y</ascending>
+        <case_sensitive>N</case_sensitive>
+        <collator_enabled>N</collator_enabled>
+        <collator_strength>0</collator_strength>
+        <presorted>N</presorted>
+      </field>
+    </fields>
+    <attributes/>
+    <GUI>
+      <xloc>224</xloc>
+      <yloc>64</yloc>
+    </GUI>
+  </transform>
+  <transform>
+    <name>validate</name>
+    <type>Dummy</type>
+    <description/>
+    <distribute>Y</distribute>
+    <custom_distribution/>
+    <copies>1</copies>
+    <partitioning>
+      <method>none</method>
+      <schema_name/>
+    </partitioning>
+    <attributes/>
+    <GUI>
+      <xloc>368</xloc>
+      <yloc>64</yloc>
+    </GUI>
+  </transform>
+  <transform_error_handling>
+  </transform_error_handling>
+  <attributes/>
+</pipeline>
diff --git 
a/integration-tests/transforms/0100-text-file-input-include-subfolders.hpl 
b/integration-tests/transforms/0100-text-file-input-include-subfolders.hpl
new file mode 100644
index 0000000000..b47bf8584f
--- /dev/null
+++ b/integration-tests/transforms/0100-text-file-input-include-subfolders.hpl
@@ -0,0 +1,202 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+-->
+<pipeline>
+  <info>
+    <pipeline_version/>
+    <capture_transform_performance>N</capture_transform_performance>
+    
<transform_performance_capturing_delay>1000</transform_performance_capturing_delay>
+    
<transform_performance_capturing_size_limit>100</transform_performance_capturing_size_limit>
+    <pipeline_type>Normal</pipeline_type>
+    <pipeline_status>0</pipeline_status>
+    <parameters/>
+    <name>0100-text-file-input-include-subfolders</name>
+    <name_sync_with_filename>Y</name_sync_with_filename>
+    <description>Issue 7166: Text File Input must honor include_subfolders 
when loading legacy file XML.</description>
+    <extended_description/>
+    <created_user>-</created_user>
+    <modified_user>-</modified_user>
+    <created_date>2026/05/25 12:00:00.000</created_date>
+    <modified_date>2026/05/25 12:00:00.000</modified_date>
+  </info>
+  <transform>
+    <type>TextFileInput2</type>
+    <name>Text file input</name>
+    <file_type>CSV</file_type>
+    <compression>None</compression>
+    <separator>,</separator>
+    <enclosure>"</enclosure>
+    <enclosure_breaks>N</enclosure_breaks>
+    <escapechar/>
+    <header>Y</header>
+    <prependFileName>N</prependFileName>
+    <nr_headerlines>1</nr_headerlines>
+    <footer>N</footer>
+    <nr_footerlines>1</nr_footerlines>
+    <line_wrapped>N</line_wrapped>
+    <nr_wraps>1</nr_wraps>
+    <layout_paged>N</layout_paged>
+    <nr_lines_per_page>80</nr_lines_per_page>
+    <nr_lines_doc_header>0</nr_lines_doc_header>
+    <noempty>Y</noempty>
+    <include>N</include>
+    <include_field/>
+    <rownum>N</rownum>
+    <rownum_field/>
+    <rownumByFile>N</rownumByFile>
+    <format>mixed</format>
+    <encoding>UTF-8</encoding>
+    <limit>-1</limit>
+    <date_format_lenient>Y</date_format_lenient>
+    <date_format_locale>en_US</date_format_locale>
+    <length>Characters</length>
+    <filters/>
+    <error_count_field/>
+    <error_fields_field/>
+    <error_text_field/>
+    <error_line_skipped>N</error_line_skipped>
+    <schema_definition/>
+    <ignore_fields>N</ignore_fields>
+    <shortFileFieldName/>
+    <extensionFieldName/>
+    <pathFieldName/>
+    <sizeFieldName/>
+    <hiddenFieldName/>
+    <lastModificationTimeFieldName/>
+    <uriNameFieldName/>
+    <rootUriNameFieldName/>
+    <files>
+      <file>
+        <name>${PROJECT_HOME}/files/file-input-include-subfolders</name>
+        <filemask>.*\.txt$</filemask>
+        <exclude_filemask/>
+        <file_required>Y</file_required>
+        <include_subfolders>Y</include_subfolders>
+      </file>
+    </files>
+    <accept_filenames>N</accept_filenames>
+    <accept_transform_name/>
+    <passing_through_fields>N</passing_through_fields>
+    <accept_field/>
+    <add_to_result_filenames>N</add_to_result_filenames>
+    <error_ignored>N</error_ignored>
+    <file_error_field/>
+    <file_error_message_field/>
+    <skip_bad_files>N</skip_bad_files>
+    <bad_line_files_destination_directory/>
+    <bad_line_files_extension/>
+    <error_line_files_destination_directory/>
+    <error_line_files_extension/>
+    <line_number_files_destination_directory/>
+    <line_number_files_extension/>
+    <fields>
+      <field>
+        <name>id</name>
+        <position>-1</position>
+        <length>-1</length>
+        <type>String</type>
+        <ignore>N</ignore>
+        <format/>
+        <trim_type>none</trim_type>
+        <precision>-1</precision>
+        <currency/>
+        <decimal/>
+        <group/>
+        <repeat>N</repeat>
+        <null_string/>
+        <if_null_value/>
+      </field>
+    </fields>
+    <distribute>Y</distribute>
+    <copies>1</copies>
+    <GUI>
+      <xloc>80</xloc>
+      <yloc>64</yloc>
+    </GUI>
+    <description/>
+    <partitioning>
+      <method>none</method>
+      <schema_name/>
+    </partitioning>
+    <attributes/>
+  </transform>
+  <transform>
+    <type>SortRows</type>
+    <name>Sort rows</name>
+    <fields>
+      <field>
+        <name>id</name>
+        <ascending>Y</ascending>
+        <case_sensitive>N</case_sensitive>
+        <collator_enabled>N</collator_enabled>
+        <collator_strength>0</collator_strength>
+        <presorted>N</presorted>
+      </field>
+    </fields>
+    <directory>${java.io.tmpdir}</directory>
+    <sort_prefix>out</sort_prefix>
+    <sort_size>1000000</sort_size>
+    <free_memory/>
+    <unique_rows>N</unique_rows>
+    <compress>N</compress>
+    <distribute>Y</distribute>
+    <copies>1</copies>
+    <GUI>
+      <xloc>224</xloc>
+      <yloc>64</yloc>
+    </GUI>
+    <description/>
+    <partitioning>
+      <method>none</method>
+      <schema_name/>
+    </partitioning>
+    <attributes/>
+  </transform>
+  <transform>
+    <type>Dummy</type>
+    <name>validate</name>
+    <distribute>Y</distribute>
+    <copies>1</copies>
+    <GUI>
+      <xloc>368</xloc>
+      <yloc>64</yloc>
+    </GUI>
+    <description/>
+    <partitioning>
+      <method>none</method>
+      <schema_name/>
+    </partitioning>
+    <attributes/>
+  </transform>
+  <order>
+    <hop>
+      <from>Text file input</from>
+      <to>Sort rows</to>
+      <enabled>Y</enabled>
+    </hop>
+    <hop>
+      <from>Sort rows</from>
+      <to>validate</to>
+      <enabled>Y</enabled>
+    </hop>
+  </order>
+  <notepads/>
+  <attributes/>
+  <transform_error_handling/>
+</pipeline>
diff --git 
a/integration-tests/transforms/datasets/golden-json-input-include-subfolders.csv
 
b/integration-tests/transforms/datasets/golden-json-input-include-subfolders.csv
new file mode 100644
index 0000000000..3ef4a85f1c
--- /dev/null
+++ 
b/integration-tests/transforms/datasets/golden-json-input-include-subfolders.csv
@@ -0,0 +1,3 @@
+id
+nested
+root
diff --git 
a/integration-tests/transforms/datasets/golden-json-normalize-input-include-subfolders.csv
 
b/integration-tests/transforms/datasets/golden-json-normalize-input-include-subfolders.csv
new file mode 100644
index 0000000000..a41e823c19
--- /dev/null
+++ 
b/integration-tests/transforms/datasets/golden-json-normalize-input-include-subfolders.csv
@@ -0,0 +1,3 @@
+id,event
+nested,e2
+root,e1
diff --git 
a/integration-tests/transforms/datasets/golden-load-file-content-include-subfolders.csv
 
b/integration-tests/transforms/datasets/golden-load-file-content-include-subfolders.csv
new file mode 100644
index 0000000000..fc5ad19ded
--- /dev/null
+++ 
b/integration-tests/transforms/datasets/golden-load-file-content-include-subfolders.csv
@@ -0,0 +1,3 @@
+short_file
+nested.txt
+root.txt
diff --git 
a/integration-tests/transforms/datasets/golden-text-file-input-include-subfolders.csv
 
b/integration-tests/transforms/datasets/golden-text-file-input-include-subfolders.csv
new file mode 100644
index 0000000000..3ef4a85f1c
--- /dev/null
+++ 
b/integration-tests/transforms/datasets/golden-text-file-input-include-subfolders.csv
@@ -0,0 +1,3 @@
+id
+nested
+root
diff --git 
a/integration-tests/transforms/files/file-input-include-subfolders/root-events.json
 
b/integration-tests/transforms/files/file-input-include-subfolders/root-events.json
new file mode 100644
index 0000000000..5bd5ae6325
--- /dev/null
+++ 
b/integration-tests/transforms/files/file-input-include-subfolders/root-events.json
@@ -0,0 +1 @@
+{"events": [{"id": "root", "event": "e1"}]}
diff --git 
a/integration-tests/transforms/files/file-input-include-subfolders/root.json 
b/integration-tests/transforms/files/file-input-include-subfolders/root.json
new file mode 100644
index 0000000000..465076acf8
--- /dev/null
+++ b/integration-tests/transforms/files/file-input-include-subfolders/root.json
@@ -0,0 +1 @@
+{"id": "root"}
diff --git 
a/integration-tests/transforms/files/file-input-include-subfolders/root.txt 
b/integration-tests/transforms/files/file-input-include-subfolders/root.txt
new file mode 100644
index 0000000000..1a9b4435b1
--- /dev/null
+++ b/integration-tests/transforms/files/file-input-include-subfolders/root.txt
@@ -0,0 +1,2 @@
+id
+root
diff --git 
a/integration-tests/transforms/files/file-input-include-subfolders/sub/nested-events.json
 
b/integration-tests/transforms/files/file-input-include-subfolders/sub/nested-events.json
new file mode 100644
index 0000000000..3f552b4095
--- /dev/null
+++ 
b/integration-tests/transforms/files/file-input-include-subfolders/sub/nested-events.json
@@ -0,0 +1 @@
+{"events": [{"id": "nested", "event": "e2"}]}
diff --git 
a/integration-tests/transforms/files/file-input-include-subfolders/sub/nested.json
 
b/integration-tests/transforms/files/file-input-include-subfolders/sub/nested.json
new file mode 100644
index 0000000000..c1cf6bdd6f
--- /dev/null
+++ 
b/integration-tests/transforms/files/file-input-include-subfolders/sub/nested.json
@@ -0,0 +1 @@
+{"id": "nested"}
diff --git 
a/integration-tests/transforms/files/file-input-include-subfolders/sub/nested.txt
 
b/integration-tests/transforms/files/file-input-include-subfolders/sub/nested.txt
new file mode 100644
index 0000000000..22d4bed128
--- /dev/null
+++ 
b/integration-tests/transforms/files/file-input-include-subfolders/sub/nested.txt
@@ -0,0 +1,2 @@
+id
+nested
diff --git 
a/integration-tests/transforms/main-0100-file-input-include-subfolders.hwf 
b/integration-tests/transforms/main-0100-file-input-include-subfolders.hwf
new file mode 100644
index 0000000000..a98ddc7369
--- /dev/null
+++ b/integration-tests/transforms/main-0100-file-input-include-subfolders.hwf
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+-->
+<workflow>
+  <name>0100-file-input-include-subfolders</name>
+  <name_sync_with_filename>Y</name_sync_with_filename>
+  <description>Issue 7166: verify file_required and include_subfolders for 
file-based input transforms.</description>
+  <extended_description/>
+  <workflow_version/>
+  <created_user>-</created_user>
+  <created_date>2026/05/25 12:00:00.000</created_date>
+  <modified_user>-</modified_user>
+  <modified_date>2026/05/25 12:00:00.000</modified_date>
+  <parameters>
+    </parameters>
+  <actions>
+    <action>
+      <name>Start</name>
+      <description/>
+      <type>SPECIAL</type>
+      <attributes/>
+      <DayOfMonth>1</DayOfMonth>
+      <doNotWaitOnFirstExecution>N</doNotWaitOnFirstExecution>
+      <hour>12</hour>
+      <intervalMinutes>60</intervalMinutes>
+      <intervalSeconds>0</intervalSeconds>
+      <minutes>0</minutes>
+      <repeat>N</repeat>
+      <schedulerType>0</schedulerType>
+      <weekDay>1</weekDay>
+      <parallel>N</parallel>
+      <xloc>80</xloc>
+      <yloc>64</yloc>
+      <attributes_hac/>
+    </action>
+    <action>
+      <name>0100 file input include subfolders tests</name>
+      <description/>
+      <type>RunPipelineTests</type>
+      <attributes/>
+      <test_names>
+        <test_name>
+          <name>0100-json-input-include-subfolders UNIT</name>
+        </test_name>
+        <test_name>
+          <name>0100-text-file-input-include-subfolders UNIT</name>
+        </test_name>
+        <test_name>
+          <name>0100-load-file-content-include-subfolders UNIT</name>
+        </test_name>
+        <test_name>
+          <name>0100-json-normalize-input-include-subfolders UNIT</name>
+        </test_name>
+      </test_names>
+      <parallel>N</parallel>
+      <xloc>320</xloc>
+      <yloc>64</yloc>
+      <attributes_hac/>
+    </action>
+  </actions>
+  <hops>
+    <hop>
+      <from>Start</from>
+      <to>0100 file input include subfolders tests</to>
+      <enabled>Y</enabled>
+      <evaluation>Y</evaluation>
+      <unconditional>Y</unconditional>
+    </hop>
+  </hops>
+  <notepads>
+  </notepads>
+  <attributes/>
+</workflow>
diff --git 
a/integration-tests/transforms/metadata/dataset/golden-json-input-include-subfolders.json
 
b/integration-tests/transforms/metadata/dataset/golden-json-input-include-subfolders.json
new file mode 100644
index 0000000000..c304f13cf9
--- /dev/null
+++ 
b/integration-tests/transforms/metadata/dataset/golden-json-input-include-subfolders.json
@@ -0,0 +1,16 @@
+{
+  "base_filename": "golden-json-input-include-subfolders.csv",
+  "name": "golden-json-input-include-subfolders",
+  "description": "JSON Input with include_subfolders=Y must read root and 
nested json files.",
+  "dataset_fields": [
+    {
+      "field_comment": "",
+      "field_length": -1,
+      "field_type": 2,
+      "field_precision": -1,
+      "field_name": "id",
+      "field_format": ""
+    }
+  ],
+  "folder_name": ""
+}
diff --git 
a/integration-tests/transforms/metadata/dataset/golden-json-normalize-input-include-subfolders.json
 
b/integration-tests/transforms/metadata/dataset/golden-json-normalize-input-include-subfolders.json
new file mode 100644
index 0000000000..55cd58b439
--- /dev/null
+++ 
b/integration-tests/transforms/metadata/dataset/golden-json-normalize-input-include-subfolders.json
@@ -0,0 +1,24 @@
+{
+  "base_filename": "golden-json-normalize-input-include-subfolders.csv",
+  "name": "golden-json-normalize-input-include-subfolders",
+  "description": "JSON Normalize Input with include_subfolders=Y must read 
root and nested event json files.",
+  "dataset_fields": [
+    {
+      "field_comment": "",
+      "field_length": -1,
+      "field_type": 2,
+      "field_precision": -1,
+      "field_name": "id",
+      "field_format": ""
+    },
+    {
+      "field_comment": "",
+      "field_length": -1,
+      "field_type": 2,
+      "field_precision": -1,
+      "field_name": "event",
+      "field_format": ""
+    }
+  ],
+  "folder_name": ""
+}
diff --git 
a/integration-tests/transforms/metadata/dataset/golden-load-file-content-include-subfolders.json
 
b/integration-tests/transforms/metadata/dataset/golden-load-file-content-include-subfolders.json
new file mode 100644
index 0000000000..b1e91ff468
--- /dev/null
+++ 
b/integration-tests/transforms/metadata/dataset/golden-load-file-content-include-subfolders.json
@@ -0,0 +1,16 @@
+{
+  "base_filename": "golden-load-file-content-include-subfolders.csv",
+  "name": "golden-load-file-content-include-subfolders",
+  "description": "Load file content with include_subfolders=Y must read root 
and nested txt files.",
+  "dataset_fields": [
+    {
+      "field_comment": "",
+      "field_length": -1,
+      "field_type": 2,
+      "field_precision": -1,
+      "field_name": "short_file",
+      "field_format": ""
+    }
+  ],
+  "folder_name": ""
+}
diff --git 
a/integration-tests/transforms/metadata/dataset/golden-text-file-input-include-subfolders.json
 
b/integration-tests/transforms/metadata/dataset/golden-text-file-input-include-subfolders.json
new file mode 100644
index 0000000000..61a1867793
--- /dev/null
+++ 
b/integration-tests/transforms/metadata/dataset/golden-text-file-input-include-subfolders.json
@@ -0,0 +1,16 @@
+{
+  "base_filename": "golden-text-file-input-include-subfolders.csv",
+  "name": "golden-text-file-input-include-subfolders",
+  "description": "Text File Input with include_subfolders=Y must read root and 
nested txt files.",
+  "dataset_fields": [
+    {
+      "field_comment": "",
+      "field_length": -1,
+      "field_type": 2,
+      "field_precision": -1,
+      "field_name": "id",
+      "field_format": ""
+    }
+  ],
+  "folder_name": ""
+}
diff --git 
a/integration-tests/transforms/metadata/unit-test/0100-json-input-include-subfolders
 UNIT.json 
b/integration-tests/transforms/metadata/unit-test/0100-json-input-include-subfolders
 UNIT.json
new file mode 100644
index 0000000000..6c2e015a2d
--- /dev/null
+++ 
b/integration-tests/transforms/metadata/unit-test/0100-json-input-include-subfolders
 UNIT.json      
@@ -0,0 +1,28 @@
+{
+  "database_replacements": [],
+  "autoOpening": true,
+  "description": "Issue 7166: JSON Input include_subfolders",
+  "persist_filename": "",
+  "test_type": "UNIT_TEST",
+  "variableValues": [],
+  "basePath": "${HOP_UNIT_TESTS_FOLDER}",
+  "golden_data_sets": [
+    {
+      "field_mappings": [
+        {
+          "transform_field": "id",
+          "data_set_field": "id"
+        }
+      ],
+      "field_order": [
+        "id"
+      ],
+      "data_set_name": "golden-json-input-include-subfolders",
+      "transform_name": "validate"
+    }
+  ],
+  "input_data_sets": [],
+  "name": "0100-json-input-include-subfolders UNIT",
+  "trans_test_tweaks": [],
+  "pipeline_filename": "./0100-json-input-include-subfolders.hpl"
+}
diff --git 
a/integration-tests/transforms/metadata/unit-test/0100-json-normalize-input-include-subfolders
 UNIT.json 
b/integration-tests/transforms/metadata/unit-test/0100-json-normalize-input-include-subfolders
 UNIT.json
new file mode 100644
index 0000000000..df3d3e6cc7
--- /dev/null
+++ 
b/integration-tests/transforms/metadata/unit-test/0100-json-normalize-input-include-subfolders
 UNIT.json    
@@ -0,0 +1,33 @@
+{
+  "database_replacements": [],
+  "autoOpening": true,
+  "description": "Issue 7166: JSON Normalize Input include_subfolders",
+  "persist_filename": "",
+  "test_type": "UNIT_TEST",
+  "variableValues": [],
+  "basePath": "${HOP_UNIT_TESTS_FOLDER}",
+  "golden_data_sets": [
+    {
+      "field_mappings": [
+        {
+          "transform_field": "id",
+          "data_set_field": "id"
+        },
+        {
+          "transform_field": "event",
+          "data_set_field": "event"
+        }
+      ],
+      "field_order": [
+        "id",
+        "event"
+      ],
+      "data_set_name": "golden-json-normalize-input-include-subfolders",
+      "transform_name": "validate"
+    }
+  ],
+  "input_data_sets": [],
+  "name": "0100-json-normalize-input-include-subfolders UNIT",
+  "trans_test_tweaks": [],
+  "pipeline_filename": "./0100-json-normalize-input-include-subfolders.hpl"
+}
diff --git 
a/integration-tests/transforms/metadata/unit-test/0100-load-file-content-include-subfolders
 UNIT.json 
b/integration-tests/transforms/metadata/unit-test/0100-load-file-content-include-subfolders
 UNIT.json
new file mode 100644
index 0000000000..d46fa0e430
--- /dev/null
+++ 
b/integration-tests/transforms/metadata/unit-test/0100-load-file-content-include-subfolders
 UNIT.json       
@@ -0,0 +1,28 @@
+{
+  "database_replacements": [],
+  "autoOpening": true,
+  "description": "Issue 7166: Load file content include_subfolders",
+  "persist_filename": "",
+  "test_type": "UNIT_TEST",
+  "variableValues": [],
+  "basePath": "${HOP_UNIT_TESTS_FOLDER}",
+  "golden_data_sets": [
+    {
+      "field_mappings": [
+        {
+          "transform_field": "short_file",
+          "data_set_field": "short_file"
+        }
+      ],
+      "field_order": [
+        "short_file"
+      ],
+      "data_set_name": "golden-load-file-content-include-subfolders",
+      "transform_name": "validate"
+    }
+  ],
+  "input_data_sets": [],
+  "name": "0100-load-file-content-include-subfolders UNIT",
+  "trans_test_tweaks": [],
+  "pipeline_filename": "./0100-load-file-content-include-subfolders.hpl"
+}
diff --git 
a/integration-tests/transforms/metadata/unit-test/0100-text-file-input-include-subfolders
 UNIT.json 
b/integration-tests/transforms/metadata/unit-test/0100-text-file-input-include-subfolders
 UNIT.json
new file mode 100644
index 0000000000..1ea85752a2
--- /dev/null
+++ 
b/integration-tests/transforms/metadata/unit-test/0100-text-file-input-include-subfolders
 UNIT.json 
@@ -0,0 +1,28 @@
+{
+  "database_replacements": [],
+  "autoOpening": true,
+  "description": "Issue 7166: Text File Input include_subfolders",
+  "persist_filename": "",
+  "test_type": "UNIT_TEST",
+  "variableValues": [],
+  "basePath": "${HOP_UNIT_TESTS_FOLDER}",
+  "golden_data_sets": [
+    {
+      "field_mappings": [
+        {
+          "transform_field": "id",
+          "data_set_field": "id"
+        }
+      ],
+      "field_order": [
+        "id"
+      ],
+      "data_set_name": "golden-text-file-input-include-subfolders",
+      "transform_name": "validate"
+    }
+  ],
+  "input_data_sets": [],
+  "name": "0100-text-file-input-include-subfolders UNIT",
+  "trans_test_tweaks": [],
+  "pipeline_filename": "./0100-text-file-input-include-subfolders.hpl"
+}
diff --git 
a/plugins/transforms/json/src/main/java/org/apache/hop/pipeline/transforms/jsonnormalize/JsonNormalizeInputMeta.java
 
b/plugins/transforms/json/src/main/java/org/apache/hop/pipeline/transforms/jsonnormalize/JsonNormalizeInputMeta.java
index 54b3177a28..979f632226 100644
--- 
a/plugins/transforms/json/src/main/java/org/apache/hop/pipeline/transforms/jsonnormalize/JsonNormalizeInputMeta.java
+++ 
b/plugins/transforms/json/src/main/java/org/apache/hop/pipeline/transforms/jsonnormalize/JsonNormalizeInputMeta.java
@@ -57,7 +57,7 @@ import org.w3c.dom.Node;
     name = "i18n::JsonNormalizeInput.name",
     description = "i18n::JsonNormalizeInput.description",
     keywords = "i18n::JsonNormalizeInputMeta.keyword",
-    categoryDescription = "i18n::JsonInput.category")
+    categoryDescription = 
"i18n:org.apache.hop.pipeline.transforms.jsoninput:JsonInput.category")
 @Getter
 @Setter
 public class JsonNormalizeInputMeta
diff --git 
a/plugins/transforms/json/src/test/java/org/apache/hop/pipeline/transforms/jsoninput/JsonInputMetaFileFlagsTest.java
 
b/plugins/transforms/json/src/test/java/org/apache/hop/pipeline/transforms/jsoninput/JsonInputMetaFileFlagsTest.java
new file mode 100644
index 0000000000..b1cceddebc
--- /dev/null
+++ 
b/plugins/transforms/json/src/test/java/org/apache/hop/pipeline/transforms/jsoninput/JsonInputMetaFileFlagsTest.java
@@ -0,0 +1,93 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hop.pipeline.transforms.jsoninput;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.Objects;
+import org.apache.hop.core.fileinput.InputFile;
+import org.apache.hop.core.plugins.PluginRegistry;
+import org.apache.hop.core.row.value.ValueMetaDate;
+import org.apache.hop.core.row.value.ValueMetaInteger;
+import org.apache.hop.core.row.value.ValueMetaJson;
+import org.apache.hop.core.row.value.ValueMetaNumber;
+import org.apache.hop.core.row.value.ValueMetaPlugin;
+import org.apache.hop.core.row.value.ValueMetaPluginType;
+import org.apache.hop.core.row.value.ValueMetaString;
+import org.apache.hop.core.xml.XmlHandler;
+import org.apache.hop.metadata.serializer.memory.MemoryMetadataProvider;
+import org.apache.hop.metadata.serializer.xml.XmlMetadataUtil;
+import org.apache.hop.pipeline.transform.TransformMeta;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+class JsonInputMetaFileFlagsTest {
+
+  @BeforeEach
+  void beforeEach() throws Exception {
+    PluginRegistry registry = PluginRegistry.getInstance();
+    String[] classNames = {
+      ValueMetaString.class.getName(),
+      ValueMetaInteger.class.getName(),
+      ValueMetaDate.class.getName(),
+      ValueMetaNumber.class.getName(),
+      ValueMetaJson.class.getName()
+    };
+    for (String className : classNames) {
+      registry.registerPluginClass(className, ValueMetaPluginType.class, 
ValueMetaPlugin.class);
+    }
+  }
+
+  @Test
+  void legacyXmlLoadsFileRequiredAndIncludeSubfolders() throws Exception {
+    Path path =
+        
Paths.get(Objects.requireNonNull(getClass().getResource("/json-input.xml")).toURI());
+    JsonInputMeta meta = new JsonInputMeta();
+    XmlMetadataUtil.deSerializeFromXml(
+        XmlHandler.loadXmlString(Files.readString(path), 
TransformMeta.XML_TAG),
+        JsonInputMeta.class,
+        meta,
+        new MemoryMetadataProvider());
+
+    assertEquals(2, meta.getFileInput().getInputFiles().size());
+    InputFile first = meta.getFileInput().getInputFiles().get(0);
+    InputFile second = meta.getFileInput().getInputFiles().get(1);
+    assertFalse(first.isFileRequired());
+    assertFalse(first.isIncludeSubFolders());
+    assertTrue(second.isFileRequired());
+    assertTrue(second.isIncludeSubFolders());
+  }
+
+  @Test
+  void includeSubFoldersDescReflectsIncludeSubFoldersField() {
+    InputFile file = new InputFile();
+    file.setFileRequired(true);
+    file.setIncludeSubFolders(false);
+    assertTrue(file.getFileRequiredDesc().contains("Y") || 
file.getFileRequiredDesc().length() > 0);
+    assertFalse(
+        file.getIncludeSubFoldersDesc().equals(file.getFileRequiredDesc()),
+        "include subfolders description must not mirror file required");
+    file.setIncludeSubFolders(true);
+    assertEquals(file.getFileRequiredDesc(), file.getIncludeSubFoldersDesc());
+  }
+}
diff --git 
a/plugins/transforms/loadfileinput/src/main/java/org/apache/hop/pipeline/transforms/loadfileinput/LoadFileInputDialog.java
 
b/plugins/transforms/loadfileinput/src/main/java/org/apache/hop/pipeline/transforms/loadfileinput/LoadFileInputDialog.java
index b72ebf38fa..8d8c484e60 100644
--- 
a/plugins/transforms/loadfileinput/src/main/java/org/apache/hop/pipeline/transforms/loadfileinput/LoadFileInputDialog.java
+++ 
b/plugins/transforms/loadfileinput/src/main/java/org/apache/hop/pipeline/transforms/loadfileinput/LoadFileInputDialog.java
@@ -1159,7 +1159,7 @@ public class LoadFileInputDialog extends 
BaseTransformDialog {
           inputFile.getFileMask(),
           inputFile.getExcludeFileMask(),
           inputFile.isFileRequired() ? CONST_COMBO_YES : CONST_COMBO_NO,
-          inputFile.isFileRequired() ? CONST_COMBO_YES : CONST_COMBO_NO);
+          inputFile.isIncludeSubFolders() ? CONST_COMBO_YES : CONST_COMBO_NO);
     }
     wFilenameList.optimizeTableView();
 


Reply via email to