public String getMimeType(String file) {

        if (defaultExternalContext != null) {
            return defaultExternalContext.getMimeType(file);
        }

        throw new UnsupportedOperationException();
        
    }
public String getMimeType ( String file ) { if ( defaultExternalContext != null ) { return defaultExternalContext . getMimeType ( file ) ; } throw new UnsupportedOperationException ( ) ; }
<p class="changed_added_2_0">Returns the MIME type of the
specified file or <code>null</code> if the MIME type is not
known.  The MIME type is determined by the container.</p>

<p class="changed_added_2_0">It is valid to call this method
during application startup or shutdown.  If called during application
startup or shutdown, this method calls through to the
<code>getMimeType()</code> method on the same container
context instance (<code>ServletContext</code> or
<code>PortletContext</code>) as the one used when calling
<code>getMimeType()</code> on the
<code>ExternalContext</code> returned by the
<code>FacesContext</code> during an actual request.</p>

<div class="changed_added_2_0">

<p><em>Servlet:</em> This must be the value returned by the
<code>javax.servlet.ServletContext</code> method
<code>getMimeType()</code>.</p>

</div>

@param file The file for which the mime type should be obtained.


@since 2.0