I need to provide an abstraction layer for a read-only source tree in Java, that includes the ability to iterate over files and subdirectories, and read contents of files. The purpose is so that I can provide a source tree to an application, whether it's a physical source tree on disk, or the contents of a .zip file, or the subcontents of a .zip file under a subdirectory, or a virtual set of files from a database.
Is there any lightweight interface / library that can help provide this abstraction layer?
I found these related questions:
- Abstraction layer over the file system and jar/zip in Java
- Java library for abstracting I/O when reading resources from folders/jar files?
and they both refer to the FileSystem
API. This is interesting but it includes lots of features for modification and notification that aren't relevant and that I would have to implement to meet the API behavior.