flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yish...@apache.org
Subject git commit: [flex-asjs] [refs/heads/develop] - Make FileProxy and IModel
Date Mon, 10 Jul 2017 08:33:30 GMT
Repository: flex-asjs
Updated Branches:
  refs/heads/develop f1e5346ec -> c6a24011b


Make FileProxy and IModel


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/c6a24011
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/c6a24011
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/c6a24011

Branch: refs/heads/develop
Commit: c6a24011bb3f9869edb0337679aa1f841765ea8b
Parents: f1e5346
Author: DESKTOP-RH4S838\Yishay <yishayjobs@hotmail.com>
Authored: Mon Jul 10 11:33:06 2017 +0300
Committer: DESKTOP-RH4S838\Yishay <yishayjobs@hotmail.com>
Committed: Mon Jul 10 11:33:06 2017 +0300

----------------------------------------------------------------------
 .../main/flex/org/apache/flex/file/FileProxy.as | 18 ++++++-
 .../flex/org/apache/flex/file/IFileModel.as     | 55 ++++++++++++++++++++
 .../org/apache/flex/file/beads/FileModel.as     | 42 ++-------------
 3 files changed, 77 insertions(+), 38 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c6a24011/frameworks/projects/Network/src/main/flex/org/apache/flex/file/FileProxy.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Network/src/main/flex/org/apache/flex/file/FileProxy.as b/frameworks/projects/Network/src/main/flex/org/apache/flex/file/FileProxy.as
index bdef5e8..738cf55 100644
--- a/frameworks/projects/Network/src/main/flex/org/apache/flex/file/FileProxy.as
+++ b/frameworks/projects/Network/src/main/flex/org/apache/flex/file/FileProxy.as
@@ -20,6 +20,7 @@ package org.apache.flex.file
 	import org.apache.flex.core.IBead;
 	import org.apache.flex.core.IDocument;
 	import org.apache.flex.core.Strand;
+	import org.apache.flex.file.beads.FileModel;
 	
 	/**
 	 *  The FileProxy class is where beads regarding file operations are added.
@@ -32,7 +33,7 @@ package org.apache.flex.file
 	 *  @playerversion AIR 2.6
 	 *  @productversion FlexJS 0.9
 	 */
-	public class FileProxy extends Strand implements IDocument
+	public class FileProxy extends Strand implements IDocument, IFileModel
 	{
 		private var _document:Object;
 		public function FileProxy()
@@ -53,5 +54,20 @@ package org.apache.flex.file
 			}
 		}
 
+		public function get lastModified():uint
+		{
+			return (model as FileModel).lastModified;
+		}
+		
+		public function get name():String
+		{
+			return (model as FileModel).name;
+		}
+		
+		public function get type():String
+		{
+			return (model as FileModel).type;
+		}
+		
 	}
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c6a24011/frameworks/projects/Network/src/main/flex/org/apache/flex/file/IFileModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Network/src/main/flex/org/apache/flex/file/IFileModel.as
b/frameworks/projects/Network/src/main/flex/org/apache/flex/file/IFileModel.as
new file mode 100644
index 0000000..a81bef8
--- /dev/null
+++ b/frameworks/projects/Network/src/main/flex/org/apache/flex/file/IFileModel.as
@@ -0,0 +1,55 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.file
+{
+	public interface IFileModel
+	{
+		/**
+		 *  The type of the file
+		 * 
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.9
+		 */
+		function get type():String;
+		
+		/**
+		 *  The last modified time of the file, in millisecond since the UNIX epoch (January 1st,
1970 at Midnight).
+		 * 
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.9
+		 */
+		function get lastModified():uint;
+
+		/**
+		 *  The name of the file
+		 * 
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.9
+		 */
+		function get name():String;
+
+		
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c6a24011/frameworks/projects/Network/src/main/flex/org/apache/flex/file/beads/FileModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Network/src/main/flex/org/apache/flex/file/beads/FileModel.as
b/frameworks/projects/Network/src/main/flex/org/apache/flex/file/beads/FileModel.as
index fa5b314..10e07b3 100644
--- a/frameworks/projects/Network/src/main/flex/org/apache/flex/file/beads/FileModel.as
+++ b/frameworks/projects/Network/src/main/flex/org/apache/flex/file/beads/FileModel.as
@@ -21,6 +21,7 @@ package org.apache.flex.file.beads
 	import org.apache.flex.core.IStrand;
 	import org.apache.flex.events.Event;
 	import org.apache.flex.events.EventDispatcher;
+	import org.apache.flex.file.IFileModel;
 	import org.apache.flex.utils.BinaryData;
 
 	COMPILE::SWF
@@ -39,7 +40,7 @@ package org.apache.flex.file.beads
 	 *  @playerversion AIR 2.6
 	 *  @productversion FlexJS 0.9
 	 */
-	public class FileModel extends EventDispatcher implements IBeadModel
+	public class FileModel extends EventDispatcher implements IBeadModel, IFileModel
 	{
 		private var _strand:IStrand;
 		private var _blob:BinaryData;
@@ -75,14 +76,7 @@ package org.apache.flex.file.beads
 		
 		
 		/**
-		 *  The size of the file bytes
-		 * 
 		 *  @copy org.apache.flex.core.IAlertModel#title
-		 *  
-		 *  @langversion 3.0
-		 *  @playerversion Flash 10.2
-		 *  @playerversion AIR 2.6
-		 *  @productversion FlexJS 0.9
 		 */
 		public function get size():Number
 		{
@@ -90,14 +84,7 @@ package org.apache.flex.file.beads
 		}
 		
 		/**
-		 *  The name of the file
-		 * 
-		 *  @copy org.apache.flex.core.IAlertModel#title
-		 *  
-		 *  @langversion 3.0
-		 *  @playerversion Flash 10.2
-		 *  @playerversion AIR 2.6
-		 *  @productversion FlexJS 0.9
+		 *  @copy org.apache.flex.file.IFileModel#name
 		 */
 		public function get name():String
 		{
@@ -106,14 +93,7 @@ package org.apache.flex.file.beads
 		
 		// TODO this will give different results in flash and in JS (extension and MIME respectively).
Fix this.
 		/**
-		 *  The type
-		 * 
-		 *  @copy org.apache.flex.core.IAlertModel#title
-		 *  
-		 *  @langversion 3.0
-		 *  @playerversion Flash 10.2
-		 *  @playerversion AIR 2.6
-		 *  @productversion FlexJS 0.9
+		 *  @copy org.apache.flex.file.IFileModel#type
 		 */
 		public function get type():String
 		{
@@ -121,14 +101,7 @@ package org.apache.flex.file.beads
 		}
 		
 		/**
-		 *  The last modified time of the file, in millisecond since the UNIX epoch (January 1st,
1970 at Midnight).
-		 * 
-		 *  @copy org.apache.flex.core.IAlertModel#title
-		 *  
-		 *  @langversion 3.0
-		 *  @playerversion Flash 10.2
-		 *  @playerversion AIR 2.6
-		 *  @productversion FlexJS 0.9
+		 *  @copy org.apache.flex.core.IAlertModel#lastModified
 		 */
 		public function get lastModified():uint
 		{
@@ -144,11 +117,6 @@ package org.apache.flex.file.beads
 		
 		/**
 		 *  @copy org.apache.flex.core.IBead#strand
-		 *  
-		 *  @langversion 3.0
-		 *  @playerversion Flash 10.2
-		 *  @playerversion AIR 2.6
-		 *  @productversion FlexJS 0.9
 		 */
 		public function set strand(value:IStrand):void
 		{


Mime
View raw message