In the first section of this tutorial, we created a very simple Styx system which exposed a single file, an InMemoryFile that simply represented a section of RAM. In this tutorial we will create a more complex namespace that includes many different resources that are exposed as Styx files.
As you might expect, it is easy to represent a file on the local filesystem as a Styx file. We do this using the FileOnDisk class that is provided with the JStyx library. As with all files that can be exposed in a Styx namespace, the FileOnDisk class inherits from the StyxFile class. Creating a FileOnDisk is very easy: the source code contains all the possible constructors, but the easiest way is simply to use the full path of the file, for example:
FileOnDisk localFile = new FileOnDisk("C:\\myfolder\\myfile");
Directories on disk...