Class FileType.ContentFileTypeMap
- java.lang.Object
-
- javax.activation.FileTypeMap
-
- org.arakhne.afc.inputoutput.filetype.FileType.ContentFileTypeMap
-
- Enclosing class:
- FileType
public static class FileType.ContentFileTypeMap extends javax.activation.FileTypeMap
Map that contains the file content type definitions.- Version:
- 17.0 2020-01-04 14:41:40
- Author:
- Stéphane GALLAND
- Maven Group Id:
- org.arakhne.afc.core
- Maven Artifact Id:
- inputoutput
-
-
Constructor Summary
Constructors Constructor Description ContentFileTypeMap()
Constructor.ContentFileTypeMap(javax.activation.FileTypeMap parent)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addContentType(MagicNumber magicNumber)
Register a MIME type of the given file.String
getContentType(File filename)
String
getContentType(String filename)
String
getContentType(URL url)
Replies the mime type of the specified url.String
getFormatVersion(File filename)
Replies the version of the format of the given file.String
getFormatVersion(String filename)
Replies the version of the format of the given file.String
getFormatVersion(URL url)
Replies the format version of the specified url.boolean
isContentType(File filename, String mimeType)
Replies if the given file has the given MIME type.boolean
isContentType(String filename, String mimeType)
Replies if the given file has the given MIME type.boolean
isContentType(URL filename, String mimeType)
Replies if the given file has the given MIME type.
-
-
-
Method Detail
-
getContentType
public String getContentType(File filename)
- Specified by:
getContentType
in classjavax.activation.FileTypeMap
-
getContentType
public String getContentType(String filename)
- Specified by:
getContentType
in classjavax.activation.FileTypeMap
-
getContentType
public String getContentType(URL url)
Replies the mime type of the specified url.- Parameters:
url
- is the location of the file to test.- Returns:
- the MIME type of the given file.
-
isContentType
public boolean isContentType(File filename, String mimeType)
Replies if the given file has the given MIME type.- Parameters:
filename
- is the filename of the file to read.mimeType
- is the restriction type.- Returns:
true
if the file has the given MIME type, otherwisefalse
-
isContentType
public boolean isContentType(String filename, String mimeType)
Replies if the given file has the given MIME type.- Parameters:
filename
- is the filename of the file to read.mimeType
- is the restriction type.- Returns:
true
if the file has the given MIME type, otherwisefalse
-
isContentType
public boolean isContentType(URL filename, String mimeType)
Replies if the given file has the given MIME type.- Parameters:
filename
- is the filename of the file to read.mimeType
- is the restriction type.- Returns:
true
if the file has the given MIME type, otherwisefalse
-
getFormatVersion
public String getFormatVersion(URL url)
Replies the format version of the specified url.- Parameters:
url
- is the name of the file to test.- Returns:
- the MIME type of the given file.
-
getFormatVersion
public String getFormatVersion(File filename)
Replies the version of the format of the given file.- Parameters:
filename
- is the name of the file to test.- Returns:
- the format version for the given file.
-
getFormatVersion
public String getFormatVersion(String filename)
Replies the version of the format of the given file.- Parameters:
filename
- is the name of the file to test.- Returns:
- the format version for the given file.
-
addContentType
public void addContentType(MagicNumber magicNumber)
Register a MIME type of the given file.- Parameters:
magicNumber
- is the string that identify the type of the content.
-
-