I am looking to create a system where a clearly-defined local filesystem folder structure follows a specific pattern. Programmatically or manually violating the pattern should throw an exception.
company/
|
---> building/
|
----> images/
| |
| --->image.jpg
|
|---> issues/
|
-----> current/
|
-----> archive/
The pattern above is simplified vs. reality (imagine 7 levels deep and wide).
My thinking is that I can use Junit to make sure the pattern is met. I started writing some custom code with the Paths API in Java 7 over Spring MVC, though it seems like there has to be a faster way that's less error prone. I would want the application to enforce the pattern rather than the OS or an external script. Are there any re-usable classes with that might do this with Junit?