You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by qu...@apache.org on 2015/05/27 05:57:43 UTC
git commit: [flex-utilities] [refs/heads/as3httpclient-work] -
Testing on as3httpclient failure methods.
Repository: flex-utilities
Updated Branches:
refs/heads/as3httpclient-work bd083afae -> 281223a9d
Testing on as3httpclient failure methods.
Project: http://git-wip-us.apache.org/repos/asf/flex-utilities/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-utilities/commit/281223a9
Tree: http://git-wip-us.apache.org/repos/asf/flex-utilities/tree/281223a9
Diff: http://git-wip-us.apache.org/repos/asf/flex-utilities/diff/281223a9
Branch: refs/heads/as3httpclient-work
Commit: 281223a9dc20a2d9f4ef26d41027a68bc03f6c29
Parents: bd083af
Author: quetwo <ni...@theflexgroup.org>
Authored: Tue May 26 23:57:54 2015 -0400
Committer: quetwo <ni...@theflexgroup.org>
Committed: Tue May 26 23:57:54 2015 -0400
----------------------------------------------------------------------
.../flex/packageflexsdk/util/ApacheURLLoader.as | 55 +++++++++++++++++---
1 file changed, 49 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/281223a9/installer/src/org/apache/flex/packageflexsdk/util/ApacheURLLoader.as
----------------------------------------------------------------------
diff --git a/installer/src/org/apache/flex/packageflexsdk/util/ApacheURLLoader.as b/installer/src/org/apache/flex/packageflexsdk/util/ApacheURLLoader.as
index ea3559d..3893821 100644
--- a/installer/src/org/apache/flex/packageflexsdk/util/ApacheURLLoader.as
+++ b/installer/src/org/apache/flex/packageflexsdk/util/ApacheURLLoader.as
@@ -27,6 +27,8 @@ package org.apache.flex.packageflexsdk.util
{
import com.adobe.net.URI;
+ import flash.events.ErrorEvent;
+
import flash.events.Event;
import flash.events.IOErrorEvent;
import flash.events.SecurityErrorEvent;
@@ -36,8 +38,11 @@ package org.apache.flex.packageflexsdk.util
import org.httpclient.HttpClient;
import org.httpclient.events.HttpDataEvent;
+ import org.httpclient.events.HttpDataListener;
import org.httpclient.events.HttpErrorEvent;
+ import org.httpclient.events.HttpRequestEvent;
import org.httpclient.events.HttpResponseEvent;
+ import org.httpclient.events.HttpStatusEvent;
public class ApacheURLLoader extends URLLoader
{
@@ -57,18 +62,56 @@ package org.apache.flex.packageflexsdk.util
}
else
{
+ trace(request.url);
var httpsClient:HttpClient = new HttpClient();
- httpsClient.addEventListener(HttpErrorEvent.ERROR, httpsErrorEvent);
- httpsClient.addEventListener(HttpDataEvent.DATA, httpsDataArrived);
- httpsClient.addEventListener(HttpResponseEvent.COMPLETE, httpsCompleteEvent);
- httpsClient.addEventListener(IOErrorEvent.IO_ERROR, httpsIOError);
- httpsClient.addEventListener(SecurityErrorEvent.SECURITY_ERROR, httpsSecurityError);
+ var httpsClientListener:HttpDataListener = new HttpDataListener();
+
+ httpsClientListener.onConnect = function(event:HttpRequestEvent):void
+ {
+ trace("connect");
+ };
+
+ httpsClientListener.onComplete = function(event:HttpResponseEvent):void
+ {
+ trace("complete.");
+ };
+
+ httpsClientListener.onClose = function(event:Event):void
+ {
+ trace("close.");
+ };
+
+ httpsClientListener.onDataComplete = function(event:HttpResponseEvent, data:ByteArray):void
+ {
+ trace("onDataComplete");
+ };
+
+ httpsClientListener.onStatus = function(event:HttpStatusEvent):void
+ {
+ trace("onStatus");
+ };
+
+ httpsClientListener.onError = function(event:ErrorEvent):void
+ {
+ trace("http error");
+ };
+
+ httpsClientListener.onData = function(event:HttpDataEvent):void
+ {
+ trace("data event.");
+ };
+
+ httpsClientListener.onRequest = function(event:HttpRequestEvent):void
+ {
+ trace("request event");
+ };
+
// ProgressEvent is not available in this manner.
// We can't emulate the HTTP Status Event. It is internal to the Flash Player and won't
// let us override the status item.
this.httpsData = new ByteArray();
- httpsClient.get(new URI(request.url));
+ httpsClient.get(new URI(request.url), httpsClientListener);
}
}