Previous | Next | Trail Map | Java Objects and the Directory | Representation in the Directory

File System

Sun's file system service provider supports storing Java objects in the file system. Specifically, it supports the binding of Referenceable(in the API reference documentation) objects. Such objects are stored as a set of properties in a file called .bindings. The parent directory that contains this .bindings file is the parent context of these bindings.

For example, if you have a file directory called food, then you can add a binding to it as follows:

ctx.bind("food/fav", new Fruit("orange"));

The binding for "fav" will be stored in the file food/.bindings. You can subsequently look up the object

Fruit f = (Fruit) ctx.lookup("food/fav");

See The Basics (in the Basics trail) trail for more examples.


Previous | Next | Trail Map | Java Objects and the Directory | Representation in the Directory