Close
dtSearch Engine API for Java
Server.convertPath Method
Syntax
Java
public native String convertPath(String path, long iSite, long flags, String reserved);

Use ConvertPath to convert between virtual and local paths. iSite is the id of the web site on a web server. If there is only one web site on the server, use 1. The "INSTANCE_ID" server variable can be used if the web server has more than one web site. (The web site id is needed because each site has its own mapping between virtual and local paths.) For the flags value, the following options are supported:

Internet Information Server stores its mapping between virtual and local paths in the Metabase. Reading this information from the Metabase is time-consuming and requires access rights that may not be available to a process running in the web server context. Therefore, the dtSearch Engine caches this information in the registry, under the key HKEY_LOCAL_MACHINE\Software\dtSearch Corp.\dtSearch\Virtual Roots. By default, ConvertPath will use the cached table values. Call ConvertPath with the dtsCpRefreshMappings + dtsCpStoreInRegistry flags to update the cached information. (Running dtWebSetup.exe, the dtSearch Web Setup program, will also update this information.) 

If ConvertPath returns a blank string, it means that either (1) the folder passed in does not have a virtual directory associated with it, or (2) the registry tables have not been refreshed since the virtual directory was created.