I’m having trouble implementing this filesystem….
Be sure that what you really want to be doing is implement FileSystem. Unless you really need to access objects in a database, remote server, or some other such storage as if they were files, you are probably heading in the wrong direction.
If you do need to implement a FileSystem, you should probably start with AbstractFileSystem - it handles a lot of knotty locking semantics correctly and will save you a lot of time, effort and bugs.