Stay organized with collections
Save and categorize content based on your preferences.
FileNameMap
public
interface
FileNameMap
A simple interface which provides a mechanism to map
between a file name and a MIME type string.
Summary
Public methods
getContentTypeFor
public abstract String getContentTypeFor (String fileName)
Gets the MIME type for the specified file name.
Parameters |
fileName |
String : the specified file name |
Returns |
String |
a String indicating the MIME
type for the specified file name. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# FileNameMap\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\nFileNameMap\n===========\n\n\n`\npublic\n\n\ninterface\nFileNameMap\n`\n\n\n`\n\n\n`\n\n|----------------------|\n| java.net.FileNameMap |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nA simple interface which provides a mechanism to map\nbetween a file name and a MIME type string.\n\nSummary\n-------\n\n| ### Public methods ||\n|---------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract `[String](/reference/java/lang/String) | ` `[getContentTypeFor](/reference/java/net/FileNameMap#getContentTypeFor(java.lang.String))`(`[String](/reference/java/lang/String)` fileName) ` Gets the MIME type for the specified file name. |\n\nPublic methods\n--------------\n\n### getContentTypeFor\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract String getContentTypeFor (String fileName)\n```\n\nGets the MIME type for the specified file name.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|------------|------------------------------------------|\n| `fileName` | `String`: the specified file name \u003cbr /\u003e |\n\n| Returns ||\n|---------------------------------------|-------------------------------------------------------------------------|\n| [String](/reference/java/lang/String) | a `String` indicating the MIME type for the specified file name. \u003cbr /\u003e |"]]