I receive a package from my manager in compressed format, and below file path structure would be there upon extracting the same. These files must be copied in a specific sequence to a Database.
--DDL
-----abc.sql
--Table
-----def.sql
--Function
-----ghi.sql
--Stored Procedure
-----jkl.sql
-----mno.sql
The requirement is such that contents of folder DDL must be applied first, then Table, then Functions and finally Stored Procedure.
Sometimes there would be only two folders like below
--Function
----abc.sql
--Stored Procedure
----jkl.sql
----mno.sql
In such cases too, stored procedure must be applied at the end. The order cannot be changed irrespective of what folders are there in the extracted file.
How to achieve this with Java? I have easily implemented this in Python.
Note: Is it possible to mix filevisitor interface in this case considering there would be sub dirs and multiple files within each directories?