Skip to content
Permalink
Browse files
Allow use of file:// when testing. The code can then use the same dow…
…nload path for local files.

git-svn-id: https://svn.apache.org/repos/asf/incubator/flex/utilities/trunk@1425241 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
aharui committed Dec 22, 2012
1 parent bdf7d82 commit f62785b44d61ca81933e42299bd150e580ea51ab
Showing 3 changed files with 9 additions and 3 deletions.
@@ -44,6 +44,7 @@ public class Constants
public static const SDK_BINARY_FILE_NAME_PREFIX:String = "apache-flex-sdk-";

public static const URL_PREFIX:String = "http://";
public static const FILE_PREFIX:String = "file://";

//--------------------------------------------------------------------------
//
@@ -432,8 +432,8 @@ variables are not required because the locations of these pieces are known.
}
else
{
if (APACHE_FLEX_BIN_DISTRO_PATH.substr(0, Constants.URL_PREFIX.length) != Constants.URL_PREFIX)
if (APACHE_FLEX_BIN_DISTRO_PATH.substr(0, Constants.URL_PREFIX.length) != Constants.URL_PREFIX &&
APACHE_FLEX_BIN_DISTRO_PATH.substr(0, Constants.FILE_PREFIX.length) != Constants.FILE_PREFIX)
{
APACHE_FLEX_BIN_DISTRO_URL = _mirrorURLUtil.mirrorURL +
APACHE_FLEX_BIN_DISTRO_PATH + APACHE_FLEX_BIN_DISTRO_FILE;
@@ -1548,6 +1548,10 @@ variables are not required because the locations of these pieces are known.
{
download(url, handlerFunction,errorFunction);
}
else if (url.search("file://") == 0)
{
download(url, handlerFunction,errorFunction);
}
else
{
var source:File = new File(url);
@@ -220,7 +220,8 @@ public class MD5CompareUtil extends EventDispatcher
_urlLoader.dataFormat = URLLoaderDataFormat.TEXT;
_urlLoader.addEventListener(Event.COMPLETE, urlLoaderResultHandler);
_urlLoader.addEventListener(IOErrorEvent.IO_ERROR, urlLoaderResultHandler);
if (remoteSDKZipPath.substr(0, Constants.URL_PREFIX.length) != Constants.URL_PREFIX)
if (remoteSDKZipPath.substr(0, Constants.URL_PREFIX.length) != Constants.URL_PREFIX &&
remoteSDKZipPath.substr(0, Constants.FILE_PREFIX.length) != Constants.FILE_PREFIX)
{
_urlLoader.load(new URLRequest(MD5_DOMAIN + remoteSDKZipPath + MD5_POSTFIX));
}

0 comments on commit f62785b

Please sign in to comment.