remove ant download caching. Will be re-implemented in Ant. The installer will pass in whether caching is enabled or not and what folder to use
Project: http://git-wip-us.apache.org/repos/asf/flex-utilities/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-utilities/commit/5ed4b9ee Tree: http://git-wip-us.apache.org/repos/asf/flex-utilities/tree/5ed4b9ee Diff: http://git-wip-us.apache.org/repos/asf/flex-utilities/diff/5ed4b9ee Branch: refs/heads/develop Commit: 5ed4b9ee1c68be87644d5565ed5bc31aeb2a9702 Parents: 04e8f60 Author: Alex Harui <aha...@apache.org> Authored: Thu May 29 08:58:50 2014 -0700 Committer: Alex Harui <aha...@apache.org> Committed: Thu May 29 09:05:26 2014 -0700 ---------------------------------------------------------------------- ant_on_air/src/org/apache/flex/ant/Ant.as | 17 ----- ant_on_air/src/org/apache/flex/ant/tags/Get.as | 67 -------------------- .../src/org/apache/flex/ant/tags/Property.as | 7 -- 3 files changed, 91 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/5ed4b9ee/ant_on_air/src/org/apache/flex/ant/Ant.as ---------------------------------------------------------------------- diff --git a/ant_on_air/src/org/apache/flex/ant/Ant.as b/ant_on_air/src/org/apache/flex/ant/Ant.as index 0036684..42bb4f9 100644 --- a/ant_on_air/src/org/apache/flex/ant/Ant.as +++ b/ant_on_air/src/org/apache/flex/ant/Ant.as @@ -42,11 +42,6 @@ package org.apache.flex.ant } /** - * Special property used to disable caching temporarily in Get task - */ - public static const DO_NOT_CACHE_NEXT_GET:String = "do-not-cache-next-get"; - - /** * @private * The file being processed. Used to determine basedir. */ @@ -252,17 +247,5 @@ package org.apache.flex.ant */ public var output:Function = function(s:String):void { trace(s) }; - /** - * Whether Get uses a download cache. Note that the cache simply - * escapes the portion of the URL after the domain and some - * file systems like Windows have a path length restriction - * so you may need to shorten URLs for really long URLs. - */ - public static var usingDownloadCache:Boolean; - - /** - * The folder Get uses as a download cache - */ - public static var downloadCacheFolder:String; } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/5ed4b9ee/ant_on_air/src/org/apache/flex/ant/tags/Get.as ---------------------------------------------------------------------- diff --git a/ant_on_air/src/org/apache/flex/ant/tags/Get.as b/ant_on_air/src/org/apache/flex/ant/tags/Get.as index bba2919..ca66d2a 100644 --- a/ant_on_air/src/org/apache/flex/ant/tags/Get.as +++ b/ant_on_air/src/org/apache/flex/ant/tags/Get.as @@ -68,18 +68,11 @@ package org.apache.flex.ant.tags } private var urlLoader:URLLoader; - private var doNotCacheNextGet:Boolean; override public function execute(callbackMode:Boolean, context:Object):Boolean { super.execute(callbackMode, context); - if (context[Ant.DO_NOT_CACHE_NEXT_GET]) - { - doNotCacheNextGet = true; - context[Ant.DO_NOT_CACHE_NEXT_GET] = false; - } - if (skipexisting) { var destFile:File = getDestFile(); @@ -94,34 +87,6 @@ package org.apache.flex.ant.tags ant.output(ant.formatOutput("get", s)); var actualSrc:String = src; - if (Ant.usingDownloadCache) - { - if (context.verbose) - ant.output(ant.formatOutput("get", "download cache is enabled")); - if (src.indexOf("http") == 0) - { - var c:int = src.indexOf("/"); - c = src.indexOf("/", c + 1); - c = src.indexOf("/", c + 1); - // that should find the slash after the server. - var cacheFile:File = File.applicationStorageDirectory.resolvePath(Ant.downloadCacheFolder); - cacheFile = cacheFile.resolvePath(escape(src.substr(c + 1))); - if (context.verbose) - ant.output(ant.formatOutput("get", "cached file is " + cacheFile.url)); - if (cacheFile.exists) - { - actualSrc = cacheFile.url; - if (context.verbose) - ant.output(ant.formatOutput("get", "found file in cache")); - } - else - { - if (context.verbose) - ant.output(ant.formatOutput("get", "did not find file in cache")); - - } - } - } var urlRequest:URLRequest = new URLRequest(actualSrc); urlRequest.followRedirects = false; urlRequest.userAgent = "Java"; // required to get sourceforge redirects to do the right thing @@ -216,38 +181,6 @@ package org.apache.flex.ant.tags fs.writeBytes(urlLoader.data as ByteArray); fs.close(); } - if (context.verbose && doNotCacheNextGet) - ant.output(ant.formatOutput("get", "caching disabled by do-not-cache-next-get")); - if (Ant.usingDownloadCache && !doNotCacheNextGet) - { - if (context.verbose) - { - ant.output(ant.formatOutput("get", "Download complete, cache is enabled")); - ant.output(ant.formatOutput("get", "Source url is: " + src)); - } - if (src.indexOf("http") == 0) - { - var c:int = src.indexOf("/"); - c = src.indexOf("/", c + 1); - c = src.indexOf("/", c + 1); - // that should find the slash after the server. - var cacheFile:File = File.applicationStorageDirectory.resolvePath(Ant.downloadCacheFolder); - cacheFile = cacheFile.resolvePath(escape(src.substr(c + 1))); - if (context.verbose) - ant.output(ant.formatOutput("get", "cached file is " + cacheFile.url)); - if (!cacheFile.exists) - { - if (context.verbose) - ant.output(ant.formatOutput("get", "adding file to cache")); - destFile.copyTo(cacheFile); - } - else - { - if (context.verbose) - ant.output(ant.formatOutput("get", "file already in cache")); - } - } - } dispatchEvent(new Event(Event.COMPLETE)); urlLoader = null; http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/5ed4b9ee/ant_on_air/src/org/apache/flex/ant/tags/Property.as ---------------------------------------------------------------------- diff --git a/ant_on_air/src/org/apache/flex/ant/tags/Property.as b/ant_on_air/src/org/apache/flex/ant/tags/Property.as index f8c8527..3acf3a3 100644 --- a/ant_on_air/src/org/apache/flex/ant/tags/Property.as +++ b/ant_on_air/src/org/apache/flex/ant/tags/Property.as @@ -51,13 +51,6 @@ package org.apache.flex.ant.tags { super.execute(callbackMode, context); - if (name == Ant.DO_NOT_CACHE_NEXT_GET) - { - // special case this flag. Overwrite if already defined - context[name] = value; - return true; - } - if (name && (value || location || refid) && !context.hasOwnProperty(name)) { if (value)