title: What URL.setFileNameMap(FileNameMap map) is used for?
body: <p>What <code>URL.setFileNameMap(FileNameMap map)</code> method does, how to use it correctly and what is it used for? Is it any useful at all?</p>
  
  <p><a href="https://docs.oracle.com/javase/8/docs/api/java/net/URLConnection.html#setFileNameMap-java.net.FileNameMap-" rel="nofollow noreferrer">Docs</a> are not very much of an explanation:</p>
  
  <blockquote>
    <p><strong>public static void setFileNameMap(FileNameMap map)</strong></p>
    
    <p>Sets the FileNameMap</p>
  </blockquote>
  
  <p>+</p>
  
  <blockquote>
    <p><strong>public static FileNameMap getFileNameMap()</strong></p>
    
    <p>Loads filename map (a <em>mimetable</em>) from a data file. It will first try
    to load the user-specific table, defined by "content.types.user.table"
    property. If that fails, it tries to load the default built-in table.</p>
  </blockquote>
  
  <p><strong>What is a mimetable and FileMap?</strong></p>
  
  <p>P.S. I read the docs for interface <a href="https://docs.oracle.com/javase/8/docs/api/java/net/FileNameMap.html" rel="nofollow noreferrer"><em>FileNameMap</em></a>. It is also very brief and gives me no clue:</p>
  
  <blockquote>
    <p>A simple interface which provides a mechanism to <em>map between a file
    name and a MIME type string</em>.</p>
    
    <p><em>String getContentTypeFor(String fileName)</em></p>
    
    <p>Gets the MIME type for the specified file name. <em>Returns: a String
    indicating the MIME type for the specified file name</em>.</p>
  </blockquote>
  
  <p>P.S. There is a <a href="https://stackoverflow.com/questions/41423633/how-to-use-filenamemap-interface-in-java">question</a>  about FileNameMap here, but it was not accepted and does not answer my question.</p>