| Package | ch.capi.net |
| Class | public class ExtensionFileSelector |
| Implements | ILoadableFileSelector |
ILoadableFile based on the extension.
var selector:ExtensionFileSelector = new ExtensionFileSelector();
selector.extensions.put("zip", LoadableFileType.BINARY);
var factory:LoadableFileFactory = new LoadableFileFactory(selector);
var file:ILoadableFile = factory.create("myFile.zip"); //creates a binary URLLoader-based ILoadableFile
| Property | Defined by | ||
|---|---|---|---|
| extensions : IMap
[read-only]
Defines the mapping between the extensions and the file type issued from
the
LoadableFileType class constants. | ExtensionFileSelector | ||
| Method | Defined by | ||
|---|---|---|---|
|
Creates a new
ExtensionFileSelector object. | ExtensionFileSelector | ||
|
Creates a
ILoadableFile using the specified LoadableFileFactory. | ExtensionFileSelector | ||
|
getExtension(request:URLRequest):String
Retrieves the extension.
| ExtensionFileSelector | ||
| extensions | property |
extensions:IMap [read-only]
Defines the mapping between the extensions and the file type issued from
the LoadableFileType class constants.
public function get extensions():IMap
See also
| ExtensionFileSelector | () | constructor |
public function ExtensionFileSelector()
Creates a new ExtensionFileSelector object.
The following extensions are defined by default :
LoadableFileType.SWFLoadableFileType.VARIABLESLoadableFileType.TEXTLoadableFileType.TEXTLoadableFileType.SOUNDLoadableFileType.SOUNDLoadableFileType.BINARYLoadableFileType.BINARYLoadableFileType.BINARYLoadableFileType.BINARYLoadableFileType.TEXTLoadableFileType.TEXT| create | () | method |
public function create(request:URLRequest, factory:LoadableFileFactory):ILoadableFile
Creates a ILoadableFile using the specified LoadableFileFactory.
request:URLRequest — The URLRequest.
|
|
factory:LoadableFileFactory — The LoadableFileFactory.
|
ILoadableFile —
The created ILoadableFile object.
|
ExtensionNotDefinedError — If the extensions into the specified request was
not found into the extensions map.
|
|
— If the file type is invalid.
|
See also
| getExtension | () | method |
public function getExtension(request:URLRequest):StringRetrieves the extension.
Parametersrequest:URLRequest — The URLRequest.
|
String — The extension of the file specified by the url.
|