Implementation of nested set design of SQL with Java - Preorder Tree Traversal
Preface
Recently, we got a requirement for storage directories and files,the condition is,
- Input parameter is the path of the root directory which was unpacked.
- The files will not change nor update after unpacked.
The details of the requirement is,
- The directories and all its subdirectories and sub-files need to be parsed into a tree structure response to the front end.
- When the user clicks on each level of directory, we need to get the files in this directory and all its subdirectories for some business data statistics.
- We can only use the MySQL.(Can’t use a graph database.)