Topic Path: Symbol Reference > Classes > TIdMimeTable Class > TIdMimeTable Methods > BuildCache Method
ContentsIndexHome
PreviousUpNext
TIdMimeTable.BuildCache Method

Populates MIME types and file extensions.

procedure BuildCache; virtual;

BuildCache is a procedure used to control populating the MIME type/subtype and file name extension mappings used in the TIdMimeTable instance. BuildCache allows the MIME type mapping to be loaded using the default values for the development platform, or populated in the OnBuildCache event handler. When a procedure has been assigned to the OnBuildCache event handler, it is entirely responsible for loading the file extensions and MIME type/subtypes used in the class instance. 

When OnBuildCache is unassigned, the default behavior is to loaded the MIME type and file extension mappings specific to the development platform. This includes loading a common set of MIME type mapping values used for both Windows and Linux development platforms. 

On the Windows platform, TIdMimeTable supplements these values by harvesting content types from the Windows HKEY_CLASSES_ROOT Registry key. 

On the Linux platform, there is no universal counterpart to the Windows Registry for MIME types. A text-based configuration file is normally present in most Linux distributions. But it's name and location in the file system hierarchy is different for each family of distributions. Each Desktop/Window manager, and many applications, maintain their own MIME type configuration files. Their names and locations are almost always radically different, too. On the Linux platform, no additional MIME types are loaded other than the known values used for both development platforms. 

No action is performed, however, when existing values are found in the MIME type mappings. 

Use LoadFromStrings to load custom MIME type mappings from a TStringList.

Copyright 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.