Files Created by the Jade Application

Use the Firewall parameter in the [Jadehttp Files] section of the JadeHttp initialization file or the Firewall configuration directive in the Jade mod_ jadehttp module to control whether Jade uses this facility for its automatic HyperText Markup Language (HTML) generation. When this parameter or directive is set to the default value of false, files are written directly to the virtual directory by Jade.

When you set this parameter or directive to true and the Firewall parameter in the [WebOptions] section of the Jade initialization file is also set to true, files are transferred to the JadeHttp library via the TCP/IP connection before being passed to the virtual directory.

The JadeWebServiceProvider and WebSession classes provide a createVirtualDirectoryFile method, which enables you to pass files created by a Jade application to the JadeHttp library.

The createVirtualDirectoryFile method has the following signature:

createVirtualDirectoryFile(fileName:     String;
                           fileContents: Binary;
                           retain:       Boolean): Integer;

The createVirtualDirectoryFile method parameters are listed in the following table.

Parameter Description
fileName Name of the file to be created in the virtual directory
fileContents Binary holding the file contents
retain Creates read-only files when set to true or standard files when set to false

The JadeHttp library creates the specified file in the directory (the virtual directory visible to web browsers) in which the library is running. This method returns zero (0) if the method successfully formats a request to the JadeHttp library or it returns the non-zero Windows error code indicating the failure to create the file.

The image files must be passed before the final reply to the web request is returned.

This process is transparent to you if your application is using the standard Jade generated Internet facility. However, if your application logic does additional file generation of its own, you must call the JadeWebServiceProvider or WebSession class createVirtualDirectoryFile method.

For web service applications, the virtual directory parameter must be specified and the fileName parameter contains only the file name. When an application transfers files to the jadehttp library by using the createVirtualDirectoryFile method for non-web service applications, the directory that is used is determined as follows.

If neither the file name nor the [application-name] section of the jadehttp.ini file or the directive ApplicationType in the Jade mod_ jadehttp module contains a directory, the files are written into the same directory as the jadehttp library module. (This enables you to control directory permissions so that the directory containing the jadehttp library module does not need to have read and write access.)

Use the JadeWebServiceProvider or WebSession class isVDFilePresent method to return whether the requested file specified in the fileName parameter of the method is present on the web server side of the firewall when using the Jade web interface via the jadehttp library file. This method sends a message to the jadehttp library file to perform this action. If the specified file name does not have a directory part, the current virtual directory defined in the VirtualDirectory parameter in the JadeHttp.ini file or the PhysicalDirectory directive in the Jade mod_ jadehttp module for the application is used. The file specified in the fileName parameter of the isVDFilePresent method is used if the file name has a directory part.

Call the JadeWebServiceProvider or WebSession class deleteVirtualDirectoryFile method to delete files that are in the virtual directory (that is, the directory specified by the value of the VirtualDirectory parameter in the JadeHttp.ini file or the PhysicalDirectory directive in the Jade mod_ jadehttp module).

The deleteVirtualDirectoryFile method parameters are listed in the following table.

Parameter Description
fileName Name of the file to be deleted from the virtual directory
deleteIfReadOnly Deletes files marked as read-only when set to true

This method returns zero (0) if the file deletion is successful or it returns a non-zero error code if the deletion fails.

If your applications are not using the standard Jade generated Internet facility, you need to set the Firewall parameter in the [Jadehttp Files] section of the jadehttp.ini file or the Firewall configuration directive in the Jade mod_ jadehttp module and the [WebOptions] section of the Jade initialization file to true and call the JadeWebServiceProvider or WebSession class createVirtualDirectoryFile method only if you require firewall separation. If you do not require firewall separation, Jade creates image files directly into the virtual directory and bypasses the JadeHttp library.

The file cleanup process that is started when the jadehttp.ini file Firewall parameter or the Jade mod_ jadehttp module Firewall configuration directive is set to true deletes only files that are not read-only and which are of type .jpg, .png, or .gif. You should therefore make all other files in this directory that you want to retain read-only, by setting the retain parameter to true.