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.
For example:
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. (Some framework already created? Visitor design pattern?) I would want the application to enforce the pattern rather than the OS or an external script.
Admins: I'll happily remove this question if it's deemed not constructive. I looked around stackoverflow and didn't find a suitable answer.
Aucun commentaire:
Enregistrer un commentaire