FileLoader
AbstractFileLoader
is a abstract implementation for a FileLoader
.
Extend AbstractFileLoader
to implement most methods required
for a ResourceLoader
.
static public FILE_NOT_FOUND_ERROR:String
public function getUri(Void):String
Returns for the location of the resource that was requested to load.
location of the resource to load
public function getPercentage(Void):Number
Returns the pecentage of the file that has been loaded.
Evaluates the current percentage of the execution by using
getBytesTotal
and getBytesLoaded
.
Returns null
if the percentage is not evaluable
percentage of the file that has been loaded
getPercentage() in org.as2lib.io.file.FileLoader
public function getTransferRate(Void):Bit
Returns the current transfer rate for the execution.
Evalutes the transfer rate by using getBytesLoaded
and
getDuration
.
transfer rate in bit (per second)
public function getBytesTotal(Void):Byte
Stub implementation for the amount of bytes that were loaded.
null
for not evaluable
public function getBytesLoaded(Void):Byte
Stub implementation for the amount of bytes to be loaded.
null
for not evaluable
public function load(uri:String, method:String, parameters:Map, callBack:Executable):Void
Prepares the loading of a certain file.
To be overwritten with the concrete load implentation. Do not forget to apply super.load().
uri | location of the resource to load |
method | (optional) POST/GET as method for submitting the parameters,
default method used if method was not passed-in is POST.
|
parameters | (optional) parameters for loading the resource |
callBack | (optional) Executable to be executed after the the resource was loaded. |
public function getParameterSubmitMethod(Void):String
Returns the method
to pass request parameters for request.
method to pass request parameters
public function getParameters(Void):Map
Sets the parameters
for the request to the resource.
Returns null
if no parameters has been set.
parameters to be passed with the resource request
public function getFile(Void):File
Returns the loaded resource.
the loaded resource
org.as2lib.io.file.ResourceNotLoadedException | if the resource has not been loaded yet |