// Path: winstone/src/main/java/net/winstone/util/MapLoader.java
// public final class MapLoader {
// 
// 	/**
// 	 * Load the specified resource bundle and build a map with all keys finded.
// 	 * 
// 	 * @param resourceBundle
// 	 *            the specified resource bundle
// 	 * @return a <code>Map</code> instance representing key/value found in the
// 	 *         specified resource bundle.
// 	 */
// 	public static Map<String, String> load(final ResourceBundle resourceBundle) {
// 		final Map<String, String> resources = new HashMap<String, String>();
// 		if (resourceBundle != null) {
// 			final Enumeration<String> keys = resourceBundle.getKeys();
// 			String key = null;
// 			while (keys.hasMoreElements()) {
// 				key = keys.nextElement();
// 				final String value = resourceBundle.getString(key);
// 				resources.put(key, value);
// 			}
// 		}
// 		return resources;
// 	}
// }


import java.net.FileNameMap;
import java.util.Collections;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.ResourceBundle;
import net.winstone.util.MapLoader;

package net.winstone;



/**
 * MimeTypes implement a FileNameMap and using a <code>MapLoader</code> in order
 * to load data (localized on file MimeTypes.properties). MimeTypes is
 * initialized on demand (@see
 * http://en.wikipedia.org/wiki/Initialization_on_demand_holder_idiom).
 * 
 *  @author <a href="mailto:jguibert@intelligents-ia.com" >Jerome Guibert</a>
 */
public class MimeTypes implements FileNameMap {

	private static final transient String UNKNOWN_EXTENSION = "unknown/unknown";

	/** an unmodifiable map of Mime type. */
	private final Map<String, String> ressource;

	/**
	 * Build a new instance of MimeTypes.
	 */
	private MimeTypes() {

// Path: winstone/src/main/java/net/winstone/util/MapLoader.java
// public final class MapLoader {
// 
// 	/**
// 	 * Load the specified resource bundle and build a map with all keys finded.
// 	 * 
// 	 * @param resourceBundle
// 	 *            the specified resource bundle
// 	 * @return a <code>Map</code> instance representing key/value found in the
// 	 *         specified resource bundle.
// 	 */
// 	public static Map<String, String> load(final ResourceBundle resourceBundle) {
// 		final Map<String, String> resources = new HashMap<String, String>();
// 		if (resourceBundle != null) {
// 			final Enumeration<String> keys = resourceBundle.getKeys();
// 			String key = null;
// 			while (keys.hasMoreElements()) {
// 				key = keys.nextElement();
// 				final String value = resourceBundle.getString(key);
// 				resources.put(key, value);
// 			}
// 		}
// 		return resources;
// 	}
// }


// Path: winstone/src/main/java/net/winstone/MimeTypes.java
import java.net.FileNameMap;
import java.util.Collections;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.ResourceBundle;
import net.winstone.util.MapLoader;

package net.winstone;



/**
 * MimeTypes implement a FileNameMap and using a <code>MapLoader</code> in order
 * to load data (localized on file MimeTypes.properties). MimeTypes is
 * initialized on demand (@see
 * http://en.wikipedia.org/wiki/Initialization_on_demand_holder_idiom).
 * 
 *  @author <a href="mailto:jguibert@intelligents-ia.com" >Jerome Guibert</a>
 */
public class MimeTypes implements FileNameMap {

	private static final transient String UNKNOWN_EXTENSION = "unknown/unknown";

	/** an unmodifiable map of Mime type. */
	private final Map<String, String> ressource;

	/**
	 * Build a new instance of MimeTypes.
	 */
	private MimeTypes() {

		this(Collections.unmodifiableMap(MapLoader.load(ResourceBundle.getBundle("mime"))));
