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.FileTypeMapMap 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 voidaddContentType(MagicNumber magicNumber)Register a MIME type of the given file.StringgetContentType(File filename)StringgetContentType(String filename)StringgetContentType(URL url)Replies the mime type of the specified url.StringgetFormatVersion(File filename)Replies the version of the format of the given file.StringgetFormatVersion(String filename)Replies the version of the format of the given file.StringgetFormatVersion(URL url)Replies the format version of the specified url.booleanisContentType(File filename, String mimeType)Replies if the given file has the given MIME type.booleanisContentType(String filename, String mimeType)Replies if the given file has the given MIME type.booleanisContentType(URL filename, String mimeType)Replies if the given file has the given MIME type.
-
-
-
Method Detail
-
getContentType
public String getContentType(File filename)
- Specified by:
getContentTypein classjavax.activation.FileTypeMap
-
getContentType
public String getContentType(String filename)
- Specified by:
getContentTypein 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:
trueif 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:
trueif 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:
trueif 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.
-
-