APIdia Launch Partner
Top Inners Fields Constructors Methods
sun.net.www

public final Class MimeTable

extends Object
implements FileNameMap
Class Inheritance
All Implemented Interfaces
java.net.FileNameMap
Imports
java.io.File, .FileInputStream, .FileNotFoundException, .InputStream, .IOException, java.net.FileNameMap, java.util.Enumeration, .Locale, .Hashtable, .Properties, .StringTokenizer

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private final Hashtable<String, MimeEntry>
extensionMap

Keyed by file extension (with the .), returns MimeEntries

private static final int
HASH_MARK

Hash mark introducing a URI fragment

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private void
private static void
fill(MimeEntry entry, String name, String value)

private MimeEntry
findByFileExtension(String fname)

Extracts the file extension and uses it to look up the entry.

private MimeEntry

Returns:

the MIME entry associated with the file name or null
findByFileName
(String
the file name
fname
)

Locate a MimeEntry by its associated file extension.

private static int
public synchronized String
getContentTypeFor(String fileName)

Implements java.net.FileNameMap.getContentTypeFor.

Gets the MIME type for the specified file name.

public static MimeTable
getDefaultTable()

Get the single instance of this class.

private synchronized void
load()

private void
parse(Properties entries)

private void
parse(String type, String attrs)

private static void
parse(String pair, MimeEntry entry)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

extensionMapback to summary
private final Hashtable<String, MimeEntry> extensionMap

Keyed by file extension (with the .), returns MimeEntries

HASH_MARKback to summary
private static final int HASH_MARK

Hash mark introducing a URI fragment

Constructor Detail

MimeTableback to summary
private MimeTable()

Method Detail

addback to summary
private void add(MimeEntry m)
fillback to summary
private static void fill(MimeEntry entry, String name, String value)
findByFileExtensionback to summary
private MimeEntry findByFileExtension(String fname)

Extracts the file extension and uses it to look up the entry.

findByFileNameback to summary
private MimeEntry findByFileName(String fname)

Locate a MimeEntry by its associated file extension. Parses general file names, and URLs.

Parameters
fname:String

the file name

Returns:MimeEntry

the MIME entry associated with the file name or null

getActionCodeback to summary
private static int getActionCode(String action)
getContentTypeForback to summary
public synchronized String getContentTypeFor(String fileName)

Implements java.net.FileNameMap.getContentTypeFor.

Doc from java.net.FileNameMap.getContentTypeFor.

Gets the MIME type for the specified file name.

getDefaultTableback to summary
public static MimeTable getDefaultTable()

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

loadback to summary
private synchronized void load()
parseback to summary
private void parse(Properties entries)
parseback to summary
private void parse(String type, String attrs)
parseback to summary
private static void parse(String pair, MimeEntry entry)
sun.net.www back to summary

private final Class MimeTable.DefaultInstanceHolder

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private static final MimeTable

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static MimeTable
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

defaultInstanceback to summary
private static final MimeTable defaultInstance

Constructor Detail

DefaultInstanceHolderback to summary
private DefaultInstanceHolder()

Method Detail

getDefaultInstanceback to summary
private static MimeTable getDefaultInstance()