4.4.2.1. initialize

The initialize method is called once on server start-up, when then content handler is loaded. The arguments passed to this method provides information about the filesystem paths where the content handler is installed, as well as initialization properties.
    public void initialize(File webBasePath,
                           String relativeAppPath,
                           Properties props) throws Exception
    {
        relativePath = new File(relativeAppPath);
        relativeURL = relativeAppPath.replace(File.separatorChar, '/');
        applicationId = relativePath.getName().trim();
    }
The relativeAppPath argument contains the filesystem path relative to the Docmenta web-application directory. In our example, we use the relativeAppPath argument, wrap it in a java.io.File object and assign it to the relativePath field. Furthermore, the relativeAppPath argument is transformed to a relative URL by replacing the operating system's filename separator by the slash character (/). The result is stored in the relativeURL field. Finally, the name of the installation folder is stored in the applicationId field (this field stores the value returned by the getApplicationId method; see below).
Note that the props argument contains the properties of the apphandler.properties file, which needs to be located in the content handler installation directory. The apphandler.properties file can be used to store content handler specific configuration properties. In our example, we don't store any configuration properties. Therefore the props argument is just ignored. See below for more information on the apphandler.properties file.