Return-Path: X-Original-To: apmail-incubator-flex-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-flex-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id ACD1AD8FC for ; Thu, 15 Nov 2012 19:57:32 +0000 (UTC) Received: (qmail 88248 invoked by uid 500); 15 Nov 2012 19:57:32 -0000 Delivered-To: apmail-incubator-flex-commits-archive@incubator.apache.org Received: (qmail 88214 invoked by uid 500); 15 Nov 2012 19:57:32 -0000 Mailing-List: contact flex-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: flex-dev@incubator.apache.org Delivered-To: mailing list flex-commits@incubator.apache.org Received: (qmail 88206 invoked by uid 99); 15 Nov 2012 19:57:32 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Nov 2012 19:57:32 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Nov 2012 19:57:28 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 0CC902388ADA; Thu, 15 Nov 2012 19:56:44 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: svn commit: r1409957 [6/12] - in /incubator/flex/utilities/trunk: common/.settings/ common/src/assets/styles/ common/src/org/apache/flex/utilities/common/ common/src/org/apache/flex/utilities/common/controls/ common/src/org/apache/flex/utilities/common... Date: Thu, 15 Nov 2012 19:56:39 -0000 To: flex-commits@incubator.apache.org From: cframpton@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20121115195644.0CC902388ADA@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Modified: incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/resource/ViewResourceConstants.as URL: http://svn.apache.org/viewvc/incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/resource/ViewResourceConstants.as?rev=1409957&r1=1409956&r2=1409957&view=diff ============================================================================== --- incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/resource/ViewResourceConstants.as (original) +++ incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/resource/ViewResourceConstants.as Thu Nov 15 19:56:32 2012 @@ -1,222 +1,222 @@ -//////////////////////////////////////////////////////////////////////////////// -// -// Licensed to the Apache Software Foundation (ASF) under one or more -// contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. -// The ASF licenses this file to You under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with -// the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -//////////////////////////////////////////////////////////////////////////////// - -package org.apache.flex.packageflexsdk.resource -{ - -import flash.events.Event; -import flash.events.EventDispatcher; -import flash.events.IEventDispatcher; -import flash.utils.Dictionary; -import flash.utils.Proxy; -import flash.utils.flash_proxy; - -import mx.collections.ArrayCollection; -import mx.events.PropertyChangeEvent; -import mx.resources.IResourceManager; -import mx.resources.ResourceManager; - -[Bindable(event="propertyChange")] -public dynamic class ViewResourceConstants extends Proxy implements IEventDispatcher -{ - - //-------------------------------------------------------------------------- - // - // Class constants - // - //-------------------------------------------------------------------------- - - public static const BUNDLE_NAME:String = "resourceStrings"; - - public static const DEFAULT_LANGUAGE:String = RuntimeLocale.EN_US; - - //-------------------------------------------------------------------------- - // - // Class properties - // - //-------------------------------------------------------------------------- - - //---------------------------------- - // instance - //---------------------------------- - - private static var _instance:ViewResourceConstants; - - public static function get instance():ViewResourceConstants - { - if (!_instance) - _instance = new ViewResourceConstants(new SE()); - - return _instance; - } - - //---------------------------------- - // supportedLanguages - //---------------------------------- - - public static function get supportedLanguages():ArrayCollection - { - var result:ArrayCollection = new ArrayCollection(); - - result.addItem({label: "English (US)", data: RuntimeLocale.EN_US}); - result.addItem({label: "English (GB)", data: RuntimeLocale.EN_GB}); - result.addItem({label: "English (AU)", data: RuntimeLocale.EN_AU}); - result.addItem({label: "Nederlands", data: RuntimeLocale.NL_NL}); - result.addItem({label: "Greek", data: RuntimeLocale.EL_GR}); - result.addItem({label: "Português", data: RuntimeLocale.PT_BR}); - - return result; - } - - //-------------------------------------------------------------------------- - // - // Constructor - // - //-------------------------------------------------------------------------- - - public function ViewResourceConstants(se:SE) - { - _eventDispatcher = new EventDispatcher(); - - RuntimeLocale.instance.installResources(); - } - - //-------------------------------------------------------------------------- - // - // Variables - // - //-------------------------------------------------------------------------- - - private var _content:Dictionary; - - private var _eventDispatcher:EventDispatcher; - - private var _resourceManager:IResourceManager = ResourceManager.getInstance();; - - //-------------------------------------------------------------------------- - // - // Methods - // - //-------------------------------------------------------------------------- - - //---------------------------------- - // addEventListener - //---------------------------------- - - public function addEventListener(type:String, listener:Function, - useCapture:Boolean = false, priority:int = 0, - useWeakReference:Boolean = false):void - { - _eventDispatcher.addEventListener(type, listener, useCapture, priority, useWeakReference); - } - - //---------------------------------- - // dispatchEvent - //---------------------------------- - - public function dispatchEvent(event:Event):Boolean - { - return _eventDispatcher.dispatchEvent(event); - } - - //---------------------------------- - // getProperty - //---------------------------------- - - override flash_proxy function getProperty(name:*):* - { - if (!_content[name]) - { - var errorString:String = "The key was not found in the resource strings (key: '" + name + "')."; - - trace(errorString); - - throw new Error(errorString); - } - - return _content[name]; - } - - //---------------------------------- - // hasEventListener - //---------------------------------- - - public function hasEventListener(type:String):Boolean - { - return _eventDispatcher.hasEventListener(type); - } - - //---------------------------------- - // removeEventListener - //---------------------------------- - - public function removeEventListener(type:String, listener:Function, - useCapture:Boolean = false):void - { - _eventDispatcher.removeEventListener(type, listener, useCapture); - } - - //---------------------------------- - // update - //---------------------------------- - - public function update(event:Event = null):void - { - _content = new Dictionary(); - - var messageStringsContentDefault:Object; - var messageStringsContentLocalized:Object; - - var n:int = _resourceManager.localeChain.length; - messageStringsContentDefault = - _resourceManager.getResourceBundle(_resourceManager.localeChain[n - 1], BUNDLE_NAME).content; - - if (n > 1) - messageStringsContentLocalized = - _resourceManager.getResourceBundle(_resourceManager.localeChain[0], BUNDLE_NAME).content; - - var useLocalizedString:Boolean; - var event:Event; - for (var key:String in messageStringsContentDefault) - { - useLocalizedString = messageStringsContentLocalized && - messageStringsContentLocalized[key] && - messageStringsContentLocalized[key] != ""; - - _content[key] = (useLocalizedString) ? - messageStringsContentLocalized[key] : messageStringsContentDefault[key]; - - event = PropertyChangeEvent.createUpdateEvent(this, key, "", _content[key]); - dispatchEvent(event); - } - } - - //---------------------------------- - // willTrigger - //---------------------------------- - - public function willTrigger(type:String):Boolean - { - return _eventDispatcher.willTrigger(type); - } - -} -} - +//////////////////////////////////////////////////////////////////////////////// +// +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//////////////////////////////////////////////////////////////////////////////// + +package org.apache.flex.packageflexsdk.resource +{ + +import flash.events.Event; +import flash.events.EventDispatcher; +import flash.events.IEventDispatcher; +import flash.utils.Dictionary; +import flash.utils.Proxy; +import flash.utils.flash_proxy; + +import mx.collections.ArrayCollection; +import mx.events.PropertyChangeEvent; +import mx.resources.IResourceManager; +import mx.resources.ResourceManager; + +[Bindable(event="propertyChange")] +public dynamic class ViewResourceConstants extends Proxy implements IEventDispatcher +{ + + //-------------------------------------------------------------------------- + // + // Class constants + // + //-------------------------------------------------------------------------- + + public static const BUNDLE_NAME:String = "resourceStrings"; + + public static const DEFAULT_LANGUAGE:String = RuntimeLocale.EN_US; + + //-------------------------------------------------------------------------- + // + // Class properties + // + //-------------------------------------------------------------------------- + + //---------------------------------- + // instance + //---------------------------------- + + private static var _instance:ViewResourceConstants; + + public static function get instance():ViewResourceConstants + { + if (!_instance) + _instance = new ViewResourceConstants(new SE()); + + return _instance; + } + + //---------------------------------- + // supportedLanguages + //---------------------------------- + + public static function get supportedLanguages():ArrayCollection + { + var result:ArrayCollection = new ArrayCollection(); + + result.addItem({label: "English (US)", data: RuntimeLocale.EN_US}); + result.addItem({label: "English (GB)", data: RuntimeLocale.EN_GB}); + result.addItem({label: "English (AU)", data: RuntimeLocale.EN_AU}); + result.addItem({label: "Nederlands", data: RuntimeLocale.NL_NL}); + result.addItem({label: "Greek", data: RuntimeLocale.EL_GR}); + result.addItem({label: "Português", data: RuntimeLocale.PT_BR}); + + return result; + } + + //-------------------------------------------------------------------------- + // + // Constructor + // + //-------------------------------------------------------------------------- + + public function ViewResourceConstants(se:SE) + { + _eventDispatcher = new EventDispatcher(); + + RuntimeLocale.instance.installResources(); + } + + //-------------------------------------------------------------------------- + // + // Variables + // + //-------------------------------------------------------------------------- + + private var _content:Dictionary; + + private var _eventDispatcher:EventDispatcher; + + private var _resourceManager:IResourceManager = ResourceManager.getInstance();; + + //-------------------------------------------------------------------------- + // + // Methods + // + //-------------------------------------------------------------------------- + + //---------------------------------- + // addEventListener + //---------------------------------- + + public function addEventListener(type:String, listener:Function, + useCapture:Boolean = false, priority:int = 0, + useWeakReference:Boolean = false):void + { + _eventDispatcher.addEventListener(type, listener, useCapture, priority, useWeakReference); + } + + //---------------------------------- + // dispatchEvent + //---------------------------------- + + public function dispatchEvent(event:Event):Boolean + { + return _eventDispatcher.dispatchEvent(event); + } + + //---------------------------------- + // getProperty + //---------------------------------- + + override flash_proxy function getProperty(name:*):* + { + if (!_content[name]) + { + var errorString:String = "The key was not found in the resource strings (key: '" + name + "')."; + + trace(errorString); + + throw new Error(errorString); + } + + return _content[name]; + } + + //---------------------------------- + // hasEventListener + //---------------------------------- + + public function hasEventListener(type:String):Boolean + { + return _eventDispatcher.hasEventListener(type); + } + + //---------------------------------- + // removeEventListener + //---------------------------------- + + public function removeEventListener(type:String, listener:Function, + useCapture:Boolean = false):void + { + _eventDispatcher.removeEventListener(type, listener, useCapture); + } + + //---------------------------------- + // update + //---------------------------------- + + public function update(event:Event = null):void + { + _content = new Dictionary(); + + var messageStringsContentDefault:Object; + var messageStringsContentLocalized:Object; + + var n:int = _resourceManager.localeChain.length; + messageStringsContentDefault = + _resourceManager.getResourceBundle(_resourceManager.localeChain[n - 1], BUNDLE_NAME).content; + + if (n > 1) + messageStringsContentLocalized = + _resourceManager.getResourceBundle(_resourceManager.localeChain[0], BUNDLE_NAME).content; + + var useLocalizedString:Boolean; + var event:Event; + for (var key:String in messageStringsContentDefault) + { + useLocalizedString = messageStringsContentLocalized && + messageStringsContentLocalized[key] && + messageStringsContentLocalized[key] != ""; + + _content[key] = (useLocalizedString) ? + messageStringsContentLocalized[key] : messageStringsContentDefault[key]; + + event = PropertyChangeEvent.createUpdateEvent(this, key, "", _content[key]); + dispatchEvent(event); + } + } + + //---------------------------------- + // willTrigger + //---------------------------------- + + public function willTrigger(type:String):Boolean + { + return _eventDispatcher.willTrigger(type); + } + +} +} + class SE {} \ No newline at end of file Propchange: incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/resource/ViewResourceConstants.as ------------------------------------------------------------------------------ svn:eol-style = native Modified: incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/util/DownloadUtil.as URL: http://svn.apache.org/viewvc/incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/util/DownloadUtil.as?rev=1409957&r1=1409956&r2=1409957&view=diff ============================================================================== --- incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/util/DownloadUtil.as (original) +++ incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/util/DownloadUtil.as Thu Nov 15 19:56:32 2012 @@ -1,94 +1,94 @@ -//////////////////////////////////////////////////////////////////////////////// -// -// Licensed to the Apache Software Foundation (ASF) under one or more -// contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. -// The ASF licenses this file to You under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with -// the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -//////////////////////////////////////////////////////////////////////////////// - -package org.apache.flex.packageflexsdk.util -{ - import flash.desktop.NativeProcess; - import flash.desktop.NativeProcessStartupInfo; - import flash.events.ErrorEvent; - import flash.events.Event; - import flash.events.IOErrorEvent; - import flash.events.NativeProcessExitEvent; - import flash.events.ProgressEvent; - import flash.filesystem.File; - import flash.net.URLLoader; - import flash.net.URLLoaderDataFormat; - import flash.net.URLRequest; - import flash.system.Capabilities; - - public class DownloadUtil - { - public static function download(url:String, completeFunction:Function, errorFunction:Function=null, progressFunction:Function=null):void - { - var loader:URLLoader = new URLLoader(); - var req:URLRequest = new URLRequest(url); - req.idleTimeout = 60000; - - loader.dataFormat = URLLoaderDataFormat.BINARY; - loader.addEventListener(Event.COMPLETE, completeFunction,false,0,true); - - if (errorFunction != null) - { - loader.addEventListener(ErrorEvent.ERROR,errorFunction,false,0,true); - loader.addEventListener(IOErrorEvent.IO_ERROR,errorFunction,false,0,true); - } - if(progressFunction != null) - { - loader.addEventListener(ProgressEvent.PROGRESS, progressFunction,false,0,true); - } - - loader.load(req); - } - - public static function invokeNativeProcess(args:Vector.):void - { - var os:String = Capabilities.os.toLowerCase(); - var info:NativeProcessStartupInfo = new NativeProcessStartupInfo(); - var cmdExe:File = (os.indexOf("win") > -1) ? new File("C:\\Windows\\System32\\cmd.exe") : null; - if (cmdExe && cmdExe.exists) - { - info.executable = cmdExe; - info.arguments = args; - } - var installProcess:NativeProcess = new NativeProcess(); - installProcess.start(info); - } - - public static function executeFile(file:File,completeFunction:Function=null):void - { - var os:String = Capabilities.os.toLowerCase(); - var info:NativeProcessStartupInfo = new NativeProcessStartupInfo(); - info.executable = file; - var process:NativeProcess = new NativeProcess(); - if(completeFunction != null) - { - process.addEventListener(NativeProcessExitEvent.EXIT, completeFunction,false,0,true); - } - process.addEventListener(NativeProcessExitEvent.EXIT, handleNativeProcessComplete,false,0,true); - process.start(info); - } - - protected static function handleNativeProcessComplete(event:NativeProcessExitEvent):void - { - var process:NativeProcess = NativeProcess(event.target); - process.closeInput(); - process.exit(true); - } - } +//////////////////////////////////////////////////////////////////////////////// +// +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//////////////////////////////////////////////////////////////////////////////// + +package org.apache.flex.packageflexsdk.util +{ + import flash.desktop.NativeProcess; + import flash.desktop.NativeProcessStartupInfo; + import flash.events.ErrorEvent; + import flash.events.Event; + import flash.events.IOErrorEvent; + import flash.events.NativeProcessExitEvent; + import flash.events.ProgressEvent; + import flash.filesystem.File; + import flash.net.URLLoader; + import flash.net.URLLoaderDataFormat; + import flash.net.URLRequest; + import flash.system.Capabilities; + + public class DownloadUtil + { + public static function download(url:String, completeFunction:Function, errorFunction:Function=null, progressFunction:Function=null):void + { + var loader:URLLoader = new URLLoader(); + var req:URLRequest = new URLRequest(url); + req.idleTimeout = 60000; + + loader.dataFormat = URLLoaderDataFormat.BINARY; + loader.addEventListener(Event.COMPLETE, completeFunction,false,0,true); + + if (errorFunction != null) + { + loader.addEventListener(ErrorEvent.ERROR,errorFunction,false,0,true); + loader.addEventListener(IOErrorEvent.IO_ERROR,errorFunction,false,0,true); + } + if(progressFunction != null) + { + loader.addEventListener(ProgressEvent.PROGRESS, progressFunction,false,0,true); + } + + loader.load(req); + } + + public static function invokeNativeProcess(args:Vector.):void + { + var os:String = Capabilities.os.toLowerCase(); + var info:NativeProcessStartupInfo = new NativeProcessStartupInfo(); + var cmdExe:File = (os.indexOf("win") > -1) ? new File("C:\\Windows\\System32\\cmd.exe") : null; + if (cmdExe && cmdExe.exists) + { + info.executable = cmdExe; + info.arguments = args; + } + var installProcess:NativeProcess = new NativeProcess(); + installProcess.start(info); + } + + public static function executeFile(file:File,completeFunction:Function=null):void + { + var os:String = Capabilities.os.toLowerCase(); + var info:NativeProcessStartupInfo = new NativeProcessStartupInfo(); + info.executable = file; + var process:NativeProcess = new NativeProcess(); + if(completeFunction != null) + { + process.addEventListener(NativeProcessExitEvent.EXIT, completeFunction,false,0,true); + } + process.addEventListener(NativeProcessExitEvent.EXIT, handleNativeProcessComplete,false,0,true); + process.start(info); + } + + protected static function handleNativeProcessComplete(event:NativeProcessExitEvent):void + { + var process:NativeProcess = NativeProcess(event.target); + process.closeInput(); + process.exit(true); + } + } } \ No newline at end of file Propchange: incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/util/DownloadUtil.as ------------------------------------------------------------------------------ svn:eol-style = native Modified: incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/util/MD5CompareUtil.as URL: http://svn.apache.org/viewvc/incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/util/MD5CompareUtil.as?rev=1409957&r1=1409956&r2=1409957&view=diff ============================================================================== --- incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/util/MD5CompareUtil.as (original) +++ incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/util/MD5CompareUtil.as Thu Nov 15 19:56:32 2012 @@ -1,227 +1,227 @@ -//////////////////////////////////////////////////////////////////////////////// -// -// Licensed to the Apache Software Foundation (ASF) under one or more -// contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. -// The ASF licenses this file to You under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with -// the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -//////////////////////////////////////////////////////////////////////////////// - -package org.apache.flex.packageflexsdk.util -{ - -import com.adobe.crypto.MD5Stream; - -import flash.events.Event; -import flash.events.EventDispatcher; -import flash.events.IOErrorEvent; -import flash.events.OutputProgressEvent; -import flash.events.ProgressEvent; -import flash.filesystem.File; -import flash.filesystem.FileMode; -import flash.filesystem.FileStream; -import flash.net.URLLoader; -import flash.net.URLLoaderDataFormat; -import flash.net.URLRequest; +//////////////////////////////////////////////////////////////////////////////// +// +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//////////////////////////////////////////////////////////////////////////////// + +package org.apache.flex.packageflexsdk.util +{ + +import com.adobe.crypto.MD5Stream; + +import flash.events.Event; +import flash.events.EventDispatcher; +import flash.events.IOErrorEvent; +import flash.events.OutputProgressEvent; +import flash.events.ProgressEvent; +import flash.filesystem.File; +import flash.filesystem.FileMode; +import flash.filesystem.FileStream; +import flash.net.URLLoader; +import flash.net.URLLoaderDataFormat; +import flash.net.URLRequest; import flash.utils.ByteArray; - -[Event(name="progress", type="flash.events.ProgressEvent")] - -public class MD5CompareUtil extends EventDispatcher -{ - - //-------------------------------------------------------------------------- - // - // Class constants - // - //-------------------------------------------------------------------------- - - public static const MD5_DOMAIN:String = "https://www.apache.org/dist/"; - - public static const MD5_POSTFIX:String = ".md5"; - - //-------------------------------------------------------------------------- - // - // Class properties - // - //-------------------------------------------------------------------------- - - //---------------------------------- - // instance - //---------------------------------- - - private static var _instance:MD5CompareUtil; - - public static function get instance():MD5CompareUtil - { - if (!_instance) - _instance = new MD5CompareUtil(new SE()); - - return _instance; - } - - //-------------------------------------------------------------------------- - // - // Constructor - // - //-------------------------------------------------------------------------- - - public function MD5CompareUtil(se:SE) {} - - //-------------------------------------------------------------------------- - // - // Variables - // - //-------------------------------------------------------------------------- - - private var _callback:Function; - - private var _file:File; - - private var _fileStream:FileStream; - - private var _remoteMD5Value:String; - - private var _md5Stream:MD5Stream; - - private var _urlLoader:URLLoader; - - //-------------------------------------------------------------------------- - // - // Properties - // - //-------------------------------------------------------------------------- - - //---------------------------------- - // errorMessage - //---------------------------------- - - private var _errorMessage:String = ""; - - public function get errorMessage():String - { - return _errorMessage; - } - - //---------------------------------- - // errorOccurred - //---------------------------------- - - private var _errorOccurred:Boolean; - - public function get errorOccurred():Boolean - { - return _errorOccurred; - } - - //---------------------------------- - // fileIsVerified - //---------------------------------- - - private var _fileIsVerified:Boolean; - - public function get fileIsVerified():Boolean - { - return _fileIsVerified; - } - - //-------------------------------------------------------------------------- - // - // Methods - // - //-------------------------------------------------------------------------- - - //---------------------------------- - // compareSignatures - //---------------------------------- - - private function compareSignatures():void - { - _md5Stream = new MD5Stream(); - - _fileStream = new FileStream(); - _fileStream.addEventListener(Event.COMPLETE, fileStreamOpenHandler); - _fileStream.addEventListener(ProgressEvent.PROGRESS, fileStreamOpenHandler); - _fileStream.addEventListener(OutputProgressEvent.OUTPUT_PROGRESS, fileStreamOpenHandler); - _fileStream.openAsync(_file, FileMode.READ); - } - - //---------------------------------- - // fileStreamOpenHandler - //---------------------------------- - - private function fileStreamOpenHandler(event:Event):void - { - var data:ByteArray = new ByteArray(); - _fileStream.readBytes(data, 0, _fileStream.bytesAvailable); - - if (event is ProgressEvent) - { - _md5Stream.update(data); - - dispatchEvent(event.clone()); - } - else - { - if (event.type == Event.COMPLETE) - { - _fileIsVerified = (_md5Stream.complete(data) == _remoteMD5Value); - - _callback(); - } - } - } - - //---------------------------------- - // urlLoaderResultHandler - //---------------------------------- - - private function urlLoaderResultHandler(event:Event):void - { - _errorOccurred = event is IOErrorEvent; - - if (!_errorOccurred) - { - _remoteMD5Value = String(_urlLoader.data); - _remoteMD5Value = _remoteMD5Value.split("\n")[0]; // we need only the first line - - compareSignatures(); - } - else - { - _errorMessage = String(IOErrorEvent(event).text); - } - } - - //---------------------------------- - // verifyMD5 - //---------------------------------- - - public function verifyMD5(localSDKZipFile:File, remoteSDKZipPath:String, - onVerificationComplete:Function):void - { - _file = localSDKZipFile; - - _callback = onVerificationComplete; - - _urlLoader = new URLLoader(); - _urlLoader.dataFormat = URLLoaderDataFormat.TEXT; - _urlLoader.addEventListener(Event.COMPLETE, urlLoaderResultHandler); - _urlLoader.addEventListener(IOErrorEvent.IO_ERROR, urlLoaderResultHandler); - _urlLoader.load(new URLRequest(MD5_DOMAIN + remoteSDKZipPath + MD5_POSTFIX)); - } - -} -} - -class SE {} \ No newline at end of file + +[Event(name="progress", type="flash.events.ProgressEvent")] + +public class MD5CompareUtil extends EventDispatcher +{ + + //-------------------------------------------------------------------------- + // + // Class constants + // + //-------------------------------------------------------------------------- + + public static const MD5_DOMAIN:String = "https://www.apache.org/dist/"; + + public static const MD5_POSTFIX:String = ".md5"; + + //-------------------------------------------------------------------------- + // + // Class properties + // + //-------------------------------------------------------------------------- + + //---------------------------------- + // instance + //---------------------------------- + + private static var _instance:MD5CompareUtil; + + public static function get instance():MD5CompareUtil + { + if (!_instance) + _instance = new MD5CompareUtil(new SE()); + + return _instance; + } + + //-------------------------------------------------------------------------- + // + // Constructor + // + //-------------------------------------------------------------------------- + + public function MD5CompareUtil(se:SE) {} + + //-------------------------------------------------------------------------- + // + // Variables + // + //-------------------------------------------------------------------------- + + private var _callback:Function; + + private var _file:File; + + private var _fileStream:FileStream; + + private var _remoteMD5Value:String; + + private var _md5Stream:MD5Stream; + + private var _urlLoader:URLLoader; + + //-------------------------------------------------------------------------- + // + // Properties + // + //-------------------------------------------------------------------------- + + //---------------------------------- + // errorMessage + //---------------------------------- + + private var _errorMessage:String = ""; + + public function get errorMessage():String + { + return _errorMessage; + } + + //---------------------------------- + // errorOccurred + //---------------------------------- + + private var _errorOccurred:Boolean; + + public function get errorOccurred():Boolean + { + return _errorOccurred; + } + + //---------------------------------- + // fileIsVerified + //---------------------------------- + + private var _fileIsVerified:Boolean; + + public function get fileIsVerified():Boolean + { + return _fileIsVerified; + } + + //-------------------------------------------------------------------------- + // + // Methods + // + //-------------------------------------------------------------------------- + + //---------------------------------- + // compareSignatures + //---------------------------------- + + private function compareSignatures():void + { + _md5Stream = new MD5Stream(); + + _fileStream = new FileStream(); + _fileStream.addEventListener(Event.COMPLETE, fileStreamOpenHandler); + _fileStream.addEventListener(ProgressEvent.PROGRESS, fileStreamOpenHandler); + _fileStream.addEventListener(OutputProgressEvent.OUTPUT_PROGRESS, fileStreamOpenHandler); + _fileStream.openAsync(_file, FileMode.READ); + } + + //---------------------------------- + // fileStreamOpenHandler + //---------------------------------- + + private function fileStreamOpenHandler(event:Event):void + { + var data:ByteArray = new ByteArray(); + _fileStream.readBytes(data, 0, _fileStream.bytesAvailable); + + if (event is ProgressEvent) + { + _md5Stream.update(data); + + dispatchEvent(event.clone()); + } + else + { + if (event.type == Event.COMPLETE) + { + _fileIsVerified = (_md5Stream.complete(data) == _remoteMD5Value); + + _callback(); + } + } + } + + //---------------------------------- + // urlLoaderResultHandler + //---------------------------------- + + private function urlLoaderResultHandler(event:Event):void + { + _errorOccurred = event is IOErrorEvent; + + if (!_errorOccurred) + { + _remoteMD5Value = String(_urlLoader.data); + _remoteMD5Value = _remoteMD5Value.split("\n")[0]; // we need only the first line + + compareSignatures(); + } + else + { + _errorMessage = String(IOErrorEvent(event).text); + } + } + + //---------------------------------- + // verifyMD5 + //---------------------------------- + + public function verifyMD5(localSDKZipFile:File, remoteSDKZipPath:String, + onVerificationComplete:Function):void + { + _file = localSDKZipFile; + + _callback = onVerificationComplete; + + _urlLoader = new URLLoader(); + _urlLoader.dataFormat = URLLoaderDataFormat.TEXT; + _urlLoader.addEventListener(Event.COMPLETE, urlLoaderResultHandler); + _urlLoader.addEventListener(IOErrorEvent.IO_ERROR, urlLoaderResultHandler); + _urlLoader.load(new URLRequest(MD5_DOMAIN + remoteSDKZipPath + MD5_POSTFIX)); + } + +} +} + +class SE {} Propchange: incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/util/MD5CompareUtil.as ------------------------------------------------------------------------------ svn:eol-style = native Modified: incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/view/UpdaterDialog.mxml URL: http://svn.apache.org/viewvc/incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/view/UpdaterDialog.mxml?rev=1409957&r1=1409956&r2=1409957&view=diff ============================================================================== --- incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/view/UpdaterDialog.mxml (original) +++ incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/view/UpdaterDialog.mxml Thu Nov 15 19:56:32 2012 @@ -1,204 +1,204 @@ - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file Propchange: incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/view/UpdaterDialog.mxml ------------------------------------------------------------------------------ svn:eol-style = native Modified: incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/view/components/AboutDialog.mxml URL: http://svn.apache.org/viewvc/incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/view/components/AboutDialog.mxml?rev=1409957&r1=1409956&r2=1409957&view=diff ============================================================================== --- incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/view/components/AboutDialog.mxml (original) +++ incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/view/components/AboutDialog.mxml Thu Nov 15 19:56:32 2012 @@ -1,26 +1,26 @@ - - - - - - + + + + + + \ No newline at end of file Propchange: incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/view/components/AboutDialog.mxml ------------------------------------------------------------------------------ svn:eol-style = native Modified: incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/view/components/AdobeLicense.mxml URL: http://svn.apache.org/viewvc/incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/view/components/AdobeLicense.mxml?rev=1409957&r1=1409956&r2=1409957&view=diff ============================================================================== --- incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/view/components/AdobeLicense.mxml (original) +++ incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/view/components/AdobeLicense.mxml Thu Nov 15 19:56:32 2012 @@ -1,79 +1,79 @@ - - - - - - - - - - - - - Adobe Flex SDK License Agreement - Third Party Terms - - - - - - - - - - - - - - + + + + + + + + + + + + + Adobe Flex SDK License Agreement + Third Party Terms + + + + + + + + + + + + + + \ No newline at end of file Propchange: incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/view/components/AdobeLicense.mxml ------------------------------------------------------------------------------ svn:eol-style = native Modified: incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/view/components/ConsoleWindow.mxml URL: http://svn.apache.org/viewvc/incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/view/components/ConsoleWindow.mxml?rev=1409957&r1=1409956&r2=1409957&view=diff ============================================================================== --- incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/view/components/ConsoleWindow.mxml (original) +++ incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/view/components/ConsoleWindow.mxml Thu Nov 15 19:56:32 2012 @@ -33,9 +33,9 @@ limitations under the License. [Bindable] public var messages:ArrayCollection = new ArrayCollection(); - protected function closeWindow(event:MouseEvent):void - { - close(); + protected function closeWindow(event:MouseEvent):void + { + close(); } private function handleCopyBtnClick(event:MouseEvent):void Propchange: incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/view/components/ConsoleWindow.mxml ------------------------------------------------------------------------------ svn:eol-style = native Modified: incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/view/components/MPLLicense.mxml URL: http://svn.apache.org/viewvc/incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/view/components/MPLLicense.mxml?rev=1409957&r1=1409956&r2=1409957&view=diff ============================================================================== --- incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/view/components/MPLLicense.mxml (original) +++ incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/view/components/MPLLicense.mxml Thu Nov 15 19:56:32 2012 @@ -1,48 +1,48 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + Propchange: incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/view/components/MPLLicense.mxml ------------------------------------------------------------------------------ svn:eol-style = native Modified: incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/view/controls/MultiStepProgressIndicator.mxml URL: http://svn.apache.org/viewvc/incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/view/controls/MultiStepProgressIndicator.mxml?rev=1409957&r1=1409956&r2=1409957&view=diff ============================================================================== --- incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/view/controls/MultiStepProgressIndicator.mxml (original) +++ incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/view/controls/MultiStepProgressIndicator.mxml Thu Nov 15 19:56:32 2012 @@ -1,37 +1,37 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + \ No newline at end of file Propchange: incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/view/controls/MultiStepProgressIndicator.mxml ------------------------------------------------------------------------------ svn:eol-style = native Modified: incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/view/itemrenderers/OptionalInstallItemRenderer.mxml URL: http://svn.apache.org/viewvc/incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/view/itemrenderers/OptionalInstallItemRenderer.mxml?rev=1409957&r1=1409956&r2=1409957&view=diff ============================================================================== --- incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/view/itemrenderers/OptionalInstallItemRenderer.mxml (original) +++ incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/view/itemrenderers/OptionalInstallItemRenderer.mxml Thu Nov 15 19:56:32 2012 @@ -1,30 +1,30 @@ - - - - - - - - - - + + + + + + + + + + Propchange: incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/view/itemrenderers/OptionalInstallItemRenderer.mxml ------------------------------------------------------------------------------ svn:eol-style = native Modified: incubator/flex/utilities/trunk/installer/src/sdk-installer-config.xml URL: http://svn.apache.org/viewvc/incubator/flex/utilities/trunk/installer/src/sdk-installer-config.xml?rev=1409957&r1=1409956&r2=1409957&view=diff ============================================================================== --- incubator/flex/utilities/trunk/installer/src/sdk-installer-config.xml (original) +++ incubator/flex/utilities/trunk/installer/src/sdk-installer-config.xml Thu Nov 15 19:56:32 2012 @@ -1,71 +1,71 @@ - - - - - - - 1.0.9 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + 1.0.9 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file Propchange: incubator/flex/utilities/trunk/installer/src/sdk-installer-config.xml ------------------------------------------------------------------------------ svn:eol-style = native