public class

MimeTable

extends Object
implements FileNameMap
java.lang.Object
   ↳ sun.net.www.MimeTable

Summary

Fields
protected static String[] mailcapLocations
Public Methods
synchronized void add(MimeEntry m)
synchronized Enumeration elements()
synchronized MimeEntry find(String type)
synchronized MimeEntry findByDescription(String description)
synchronized MimeEntry findByExt(String fileExtension)
Locate a MimeEntry by the file extension that has been associated with it.
MimeEntry findByFileName(String fname)
Locate a MimeEntry by the file extension that has been associated with it.
Properties getAsProperties()
synchronized String getContentTypeFor(String fileName)
Gets the MIME type for the specified file name.
static MimeTable getDefaultTable()
Get the single instance of this class.
synchronized int getSize()
synchronized void load()
static FileNameMap loadTable()
synchronized MimeEntry remove(MimeEntry entry)
synchronized MimeEntry remove(String type)
synchronized boolean save(String filename)
Protected Methods
boolean saveAsProperties(File file)
[Expand]
Inherited Methods
From class java.lang.Object
From interface java.net.FileNameMap

Fields

protected static String[] mailcapLocations

Public Methods

public synchronized void add (MimeEntry m)

public synchronized Enumeration elements ()

public synchronized MimeEntry find (String type)

public synchronized MimeEntry findByDescription (String description)

public synchronized MimeEntry findByExt (String fileExtension)

Locate a MimeEntry by the file extension that has been associated with it.

public MimeEntry findByFileName (String fname)

Locate a MimeEntry by the file extension that has been associated with it. Parses general file names, and URLs.

public Properties getAsProperties ()

public synchronized String getContentTypeFor (String fileName)

Gets the MIME type for the specified file name.

Parameters
fileName the specified file name
Returns
  • a String indicating the MIME type for the specified file name.

public static MimeTable getDefaultTable ()

Get the single instance of this class. First use will load the table from a data file.

public synchronized int getSize ()

public synchronized void load ()

public static FileNameMap loadTable ()

public synchronized MimeEntry remove (MimeEntry entry)

public synchronized MimeEntry remove (String type)

public synchronized boolean save (String filename)

Protected Methods

protected boolean saveAsProperties (File file)