public class ERMimeType extends Object
Constructor and Description |
---|
ERMimeType(String name,
String mimeType,
String uti,
NSArray<String> extensions)
Constructs an ERMimeType.
|
Modifier and Type | Method and Description |
---|---|
NSArray<String> |
extensions()
Returns the list of extensions that map to this mime type.
|
ERGlobMimeType |
globMimeType()
Returns the glob type of this mime type (image/pdf=>image/*).
|
boolean |
isAudio()
Returns true for audio/<whatever> mime types.
|
boolean |
isImage()
Returns true for image/<whatever> mime types.
|
boolean |
isRepresentedByExtension(String extension)
Returns true if this mime type represents a file of the given extension.
|
boolean |
isVideo()
Returns true for video/<whatever> mime types.
|
boolean |
matches(ERMimeType otherMimeType)
Supports glob mime types for comparison, so image/* matches image/jpeg.
|
boolean |
matchesExactly(ERMimeType mimeType)
Returns true if this mime type exactly matches the other, meaning, the
underlying mime type strings are identical.
|
String |
mimeType()
Returns the mime type string representation.
|
String |
name()
Returns the name of this mime type.
|
String |
primaryExtension()
Returns the "primary" extension for this mime type.
|
String |
subtype()
Returns the part of the mime type after the "/".
|
String |
toString() |
String |
type()
Returns the part of the mime type before the "/".
|
String |
uti()
Returns the universal type identifier.
|
public ERMimeType(String name, String mimeType, String uti, NSArray<String> extensions)
name
- mimeType
- uti
- extensions
- public ERGlobMimeType globMimeType()
public boolean matchesExactly(ERMimeType mimeType)
mimeType
- public boolean matches(ERMimeType otherMimeType)
otherMimeType
- public String name()
public String mimeType()
public String uti()
public NSArray<String> extensions()
public boolean isRepresentedByExtension(String extension)
extension
- public String primaryExtension()
public String type()
public String subtype()
public boolean isImage()
public boolean isVideo()
public boolean isAudio()
Copyright © 2002 – 2020 Project Wonder.