Table of Contents

OIL2 Class Standard.ReadMIMEtypeFile

class Standard . ReadMIMEtypeFile {
        string  serviceName;
inherits from Object;


The ReadMIMEtypeFile convenience class reads an Apache-style mime.conf (or equivalent) file and builds a mapping table that can be used by HTTP-related applications to infer the type of a document from its file suffix.



ReadMIMEtypeFile:create(optional any fileName, optional string servName)

Method Description

The create method's first argument is either a file name specification or the object Id of an object allomorphic to IOobject. The parameter is is passed unmodified to a ReadAndProcessFile object. An optional second argument may be specified. If present, the ReadMIMEtypeFile object is registered as providing a local service using the indicated name.


ReadMIMEtypeFile:fileTypeToMIMEtype(string fileName)

Method Description

The MIME type implied by a file name can be obtained using the fileTypeToMIMEtype method. It takes a single argument, which is a file name. A MIME type is always returned; if a MIME type can not be infered from the file name, a default of "application/octet-stream" is returned.