| Package | vegas.net |
| Class | public class MIME |
| Inheritance | MIME Object |
See : http://www.iana.org/assignments/media-types/text/ and http://www.mimetype.org/
Example :
import vegas.net.MIME ;
trace( "MIME type 'video/mpeg' extensions : " + MIME.getExtensions("video/mpeg") ) ;
trace( "MIME type of the htm extension : " + MIME.getMimeTypeByExtension("htm") ) ;
trace( "MIME type of the jar extension : " + MIME.getMimeTypeByExtension("jar") ) ;
trace( "---" ) ;
trace( "All MIME types : " + MIME.getMimeTypes() ) ;
| Property | Defined By | ||
|---|---|---|---|
| extensions : Array [read-only]
The set of all extensions of this MimeType. | MIME | ||
| subType : String
The subType of the MIME type. | MIME | ||
| type : String
The type of the MIME type. | MIME | ||
| Method | Defined By | ||
|---|---|---|---|
MIME(mimeType:String = null, extensions:Array = null)
Creates a new Mime instance. | MIME | ||
addExtension(ext:String):Boolean
Add a new extension in the collection of all extensions of this MIME type. | MIME | ||
addMimeType(mimeType:String, ... extensions):void [static]
Adds the specified mimeType in the dictionary of all MIME types and specified this extensions. | MIME | ||
getExtensions(mimeType:String):Array [static]
Returns the Array representaiton of all extensions of the specified MIME type. | MIME | ||
getMimeType(mimeType:String):MIME [static]
Returns the MIME representation of the specified mimeType expression. | MIME | ||
getMimeTypeByExtension(ext:String):MIME [static]
Returns the MIME representation of the specified mimeType expression. | MIME | ||
getMimeTypes():Array [static]
Returns the MIME representation of the specified mimeType expression. | MIME | ||
removeExtension(ext:String):Boolean
Removes an extension in the collection of all extensions of this MIME type. | MIME | ||
toString():String
Returns the String representation of the object. | MIME | ||
valueOf():String
Returns the real value of the object. | MIME | ||
| Constant | Defined By | ||
|---|---|---|---|
| TYPES : Dictionary [static]
The types dictionary of all MIME types. | MIME | ||
| extensions | property |
extensions:Array [read-only] The set of all extensions of this MimeType.
public function get extensions():Array| subType | property |
public var subType:StringThe subType of the MIME type.
| type | property |
public var type:StringThe type of the MIME type.
| MIME | () | Constructor |
public function MIME(mimeType:String = null, extensions:Array = null)Creates a new Mime instance.
ParametersmimeType:String (default = null) — The MIME type expression to register.
| |
extensions:Array (default = null) — The optional Array representation of all extensions of this MIME type.
|
| addExtension | () | method |
public function addExtension(ext:String):BooleanAdd a new extension in the collection of all extensions of this MIME type.
Parameters
ext:String |
Boolean — true if the extension is inserted in the collection of all extensions.
|
| addMimeType | () | method |
public static function addMimeType(mimeType:String, ... extensions):voidAdds the specified mimeType in the dictionary of all MIME types and specified this extensions.
Parameters
mimeType:String | |
... extensions |
| getExtensions | () | method |
public static function getExtensions(mimeType:String):ArrayReturns the Array representaiton of all extensions of the specified MIME type.
Parameters
mimeType:String |
Array — the Array representaiton of all extensions of the specified MIME type.
|
| getMimeType | () | method |
public static function getMimeType(mimeType:String):MIMEReturns the MIME representation of the specified mimeType expression.
Parameters
mimeType:String |
MIME — the MIME representation of the specified mimeType expression.
|
| getMimeTypeByExtension | () | method |
public static function getMimeTypeByExtension(ext:String):MIMEReturns the MIME representation of the specified mimeType expression.
Parameters
ext:String |
MIME — the MIME representation of the specified mimeType expression.
|
| getMimeTypes | () | method |
public static function getMimeTypes():ArrayReturns the MIME representation of the specified mimeType expression.
ReturnsArray — the MIME representation of the specified mimeType expression.
|
| removeExtension | () | method |
public function removeExtension(ext:String):BooleanRemoves an extension in the collection of all extensions of this MIME type.
Parameters
ext:String |
Boolean — true if the extension is removed.
|
| toString | () | method |
public function toString():StringReturns the String representation of the object.
ReturnsString — the String representation of the object.
|
| valueOf | () | method |
public function valueOf():StringReturns the real value of the object.
ReturnsString — the real value of the object.
|
| TYPES | Constant |
public static const TYPES:DictionaryThe types dictionary of all MIME types.