You can use the same configuration file and command-line mechanisms to set application-specific properties. For example, we could introduce a property to control the maximum file size for our file system application:
The Ice run time stores the
Filesystem.MaxFileSize property like any other property and makes it accessible via the
To access property values from within your program, you need to acquire the communicator's properties by calling
Properties interface is shown below:
Properties interface also provides two utility operations that are useful if you need to work with multiple communicators that use different property sets:
This operation makes a copy of an existing property set. The copy contains exactly the same properties and values as the original.
This operation accepts a path name to a configuration file and initializes the property set from that file. If the specified file cannot be read (for example, because it does not exist or the caller does not have read permission), the operation throws a
FileException. In Java, the given path name can refer to a class loader resource or a regular file.