Main Page Cookbook/Overview ImageMeister the jcprops file Licensing Please Vote! Binary Installation & Configuration [ Win · Mac · Nix · OSX ] Changes Public API Source Code Main Page Java [ Common · Win · Mac · Nix ] Native Code [ Common · Win · Mac · Nix ] Manifest Native Code Overviews [ Common · Win · Mac · Nix · Strings ] Macros [ General · Native Macros ] Walkthroughs [ Java only · Java and native ] Building [ Win · Mac · Nix · OSX ] Distribution Issues

# Configuration Using jcprops.txt

> This page describes how the file jcprops.txt can be used to modify the default JConfig behavior. jcprops.txt contains a series of properties, such as:

>     com.jconfig.mac.FileRegistryFactoryMac.getApps=0
>     com.jconfig.mac.FileRegistryFactoryMac.launchURL=0

> Setting properties in this file to certain values can be used to change the default behavior. This file does not have to exist; if the file does not exist, or if a specific property is not found, the default behavior will be used.

> If you wish to use this file, make sure it's in the directory provided to the FileRegistry.initialize() method; i.e., it should be in the same directory as jconfig.cfg and jcfactrz.txt.

> The platform-specific properties are described beloe.

## Mac

> There are currently six properties, all of which are Mac-specific. The first indicates which class will be used to com.jconfig.mac.FileRegistryMRJ.FileUtilsClassName

> The other five properties correspond to these five methods of the FileRegistry:

> - findExtensions(...)
> - findFinderInfo(...)
> - getApps(...)
> - iterate(...)
> - launchURL(...)
> Note that the FileRegistry contains three getApps() methods: the only method affected by jcprops.txt is the one used for finding apps by name, FileRegistry.getApps( String appName,...) The other two FileRegistry.getApps() methods are not affected.

> The properties associated with these methods are as follows:

> - findExtensions: com.jconfig.mac.FileRegistryFactoryMac.findExtensions
> - findFinderInfo: com.jconfig.mac.FileRegistryFactoryMac.findFinderInfo
> - getApps: com.jconfig.mac.FileRegistryFactoryMac.getApps
> - iterate: com.jconfig.mac.FileRegistryFactoryMac.iterate
> - launchURL: com.jconfig.mac.FileRegistryFactoryMac.launchURL

> Currently, each of these properties only has two values: default, and non-default.

> For each property, you can obtain the default value in any one of the following cases:

> - The file jcprops.txt can't be found,
> - jcprops.txt can be found, but the property is not listed,
> - the property is listed, and its value is 0 (zero), or
> - the property is listed, and its value is not a number.

> To obtain the non-default value, all these cases must be true:

> - the file jcprops.txt can be found,
> - the property must be listed in this file, and
> - the property must have a non-zero, numeric value. For future compatibility, this number should be 1.

> As an example, if jcprops.txt contains the following:

>     com.jconfig.mac.FileRegistryFactoryMac.findExtensions=0
>     com.jconfig.mac.FileRegistryFactoryMac.findFinderInfo=1
>     com.jconfig.mac.FileRegistryFactoryMac.getApps=aaaa

> The properties will have the following values:
> - findExtensions will be 0
> - findFinderInfo will be 1
> - getApps will be 0
> - iterate will be 0
> - launchURL will be 0

> The effect of each property on these methods is given below in pseudo-code.

> In the following, icConfig is a wrapper around InternetConfig. This will be null only if InternetConfig was not installed, or could not be loaded.

> plainConfig is the object created using the contents of the file jconfig.cfg. Note that if jconfig.cfg can't be found, internally stored values are used. In almost all cases, plainConfig will not be null (unless there are severe memory problems.)

> The five FileRegistry methods listed above end up being calls to either icConfig or plainConfig, depending on whether icConfig is null, and depending on the values of the five properties.

>     findExtensions
>     findFinderInfo
>     iterate

>             if ( *the property* == 0 ) {
>                 if ( icConfig != null )
>                     use icConfig
>                 else
>                     use plainConfig
>             }
>             else {
>                 if ( plainConfig != null )
>                     use plainConfig
>                 else
>                     use icConfig
>             }

>     getApps

>             if ( *the property* == 0 && icConfig != null )
>                 use icConfig
>             else
>                 use this class' iterate() method

>     launchURL

>             if ( *the property* == 0 && icConfig != null ) {
>                 try to launch using icConfig
>                 if that works, return
>             }

>             search and launch a browser using creator codes (see the [BRWS,5000] resource in JConfig.shlb)

Main Page · JConfig · ImageMeister · System Properties Repository · Native Macros · Free Samples · WordMeister · Java Freeware · Links · Contact Us

Copyright (c) 1997-2002 Samizdat Productions. All Rights Reserved.
JConfig and ImageMeister are trademarks of Samizdat Productions. Other trademarks are the property of their respective owners.
samizdat@tolstoy.com