Class org.as2lib.io.file.FileLoaderProcess

Implemented Interfaces

LoadStartListener LoadCompleteListener LoadProgressListener LoadErrorListener

Description

FileLoaderProcess is a mediator to handle loading of files as a Process.

If you need to handle a FileLoader with a Process context you can use FileLoaderProcess as mediator between both APIs.

In contrast to FileLoader you have to call it like: import org.as2lib.io.file.TextFileLoader; import org.as2lib.io.file.FileLoaderProcess; var fileLoader:TextFileLoader = new TextFileLoader(); var loader:FileLoaderProcess = new FileLoaderProcess(fileLoader); loader.setUri("test.txt"); loader.start();

Field Index

Inherited from LogSupport

Method Index

new FileLoaderProcess()
getFileLoader(), getPercentage(), onLoadComplete(), onLoadError(), onLoadProgress(), onLoadStart(), run(), setUri()

Inherited from AbstractProcess

Inherited from AbstractTimeConsumer

Inherited from EventSupport

Inherited from LogSupport

Inherited from BasicClass

Constructor Detail

FileLoaderProcess

public function FileLoaderProcess(resourceLoader:FileLoader)

Constructs a new FileLoaderProcess.

Parameters

resourceLoader FileLoader to be mediated

Method Detail

setUri

public function setUri(uri:String, method:String, parameter:Map, callBack:Executable):Void

Prepares the instance for loading events.

All passed-in parameters will be used to .load the certain resource.

Parameters

urilocation 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.
callBack(optional) Executable to be executed after the the resource was loaded.

getFileLoader

public function getFileLoader(Void):FileLoader

Returns the FileLoader that was mediated.

Return

FileLoader that was mediated.

run

public function run()

Implementation of to handle loading of the process.

getPercentage

public function getPercentage(Void):Number

Forwards getPercentage to the mediated FileLoader.getPercentage.

Return

percentage of the resource

Specified By

getPercentage() in org.as2lib.app.exec.Process

Overrides

getPercentage() in org.as2lib.app.exec.AbstractTimeConsumer

onLoadStart

public function onLoadStart(resourceLoader:FileLoader):Void

Handles the FileLoaders start event.

Parameters

resourceLoader FileLoader that sent the event

Specified By

onLoadStart() in org.as2lib.io.file.LoadStartListener

onLoadComplete

public function onLoadComplete(resourceLoader:FileLoader):Void

Handles the FileLoaders complete event.

Parameters

resourceLoader FileLoader that sent the event

Specified By

onLoadComplete() in org.as2lib.io.file.LoadCompleteListener

onLoadProgress

public function onLoadProgress(resourceLoader:FileLoader):Void

Handles the FileLoaders progress event.

Parameters

resourceLoader FileLoader that sent the event

Specified By

onLoadProgress() in org.as2lib.io.file.LoadProgressListener

onLoadError

public function onLoadError(resourceLoader:FileLoader, errorCode:String, error):Boolean

Handles the FileLoaders error event.

Parameters

resourceLoader FileLoader that sent the event

Specified By

onLoadError() in org.as2lib.io.file.LoadErrorListener