| Package | com.adobe.rtc.sharedManagers |
| Class | public class FileManager |
| Inheritance | FileManager flash.events.EventDispatcher |
| Implements | ISessionSubscriber |
The FileManager keeps files in "groups," with permissions settable on a per-group basis. Users with the owner role are able to add, modify, and delete these groups. By default, only users with a publisher role and higher may publish a file to a group, while those with role of viewer or higher are able to download.
Note: If you're listening to the NEW_FILE_DESCRIPTOR and UPDATE_FILE_DESCRIPTOR
events, just because the Manager dispatches a NEW_FILE_DESCRIPTOR does not mean that the
file is ready for download. On the contrary, the NEW_FILE_DESCRIPTOR is emitted when the
file is ready to begin uploading, not after it's uploaded. Instead, listen to UPDATE_FILE_DESCRIPTOR,
and check to see when the uploadProgress property of FileDescriptor equals 100.
Each IConnectSession handles creation/setup of its own FileManager instance. Use an IConnectSession's
fileManager property to access it.
See also
| Property | Defined by | ||
|---|---|---|---|
| amIUploadingFile : Boolean
Specifies whether the current user is currently uploading a file.
| FileManager | ||
| connectSession : IConnectSession
(Read Only) Specifies the IConnectSession to which this manager is assigned.
| FileManager | ||
| fileDescriptors : ArrayCollection
The set of all
fileDescriptors in the room. | FileManager | ||
| isSynchronized : Boolean [read-only]
Returns true if the model is synchronized.
| FileManager | ||
| maxFileSize : Number [read-only]
Specifies the maximum filesize allowed.
| FileManager | ||
| Method | Defined by | ||
|---|---|---|---|
|
Constructor.
| FileManager | ||
|
canIUpload(p_groupName:String):Boolean
Indicates whether or not the local client has upload privileges on the chosen group.
| FileManager | ||
|
clearFileDescriptor(p_id:String):void
Clears a file descriptor by retracting the file in question and thereby making it
unavailable for download.
| FileManager | ||
|
createGroup(p_groupName:String, p_nodeConfiguration:NodeConfiguration = null):void
Creates a new group for files with the specified name and
nodeConfiguration. | FileManager | ||
|
findGroupFor(p_id:String):String
Returns the group name of which the indicated descriptor is a member.
| FileManager | ||
|
getFileDescriptor(p_id:String):FileDescriptor
Returns a specific file descriptor.
| FileManager | ||
|
getFileDescriptors(p_groupName:String):ArrayCollection
Returns the set of
fileDescriptors in a specified group. | FileManager | ||
|
getGroupNames():Array
Returns all the group names.
| FileManager | ||
|
getNodeConfiguration(p_groupName:String):NodeConfiguration
Gets the NodeConfiguration of a node within a group.
| FileManager | ||
|
getUserRole(p_userID:String, p_groupName:String = null):int
Gets the role of the specified user for a particular group.
| FileManager | ||
|
isGroupDefined(p_groupName:String):Boolean
Returns whether or not a specified group exists.
| FileManager | ||
|
publishFileDescriptor(p_descriptor:FileDescriptor, p_associatedUserID:String = null):void
Announces to the service that a file will be uploaded for the first time by the
local client or by somebody else.
| FileManager | ||
|
removeGroup(p_groupName:String):void
Removes a group if it does exist as well as the nodes associated with it.
| FileManager | ||
|
setNodeConfiguration(p_nodeConf:NodeConfiguration, p_groupName:String):void
Sets the NodeConfiguration of a node within a group.
| FileManager | ||
|
setUserRole(p_userID:String, p_role:int, p_groupName:String):void
Sets the specified user's role to the indicated role for the node.
| FileManager | ||
|
updateFileDescriptor(p_id:String, p_name:String = null, p_filename:String = null, p_url:String = null, p_type:String = null, p_size:int = -1, p_uploadProgress:Number = -1, p_state:String = null):void
Updates any field of a file descriptor except for its
ID, submitterID,
and lastModified. | FileManager | ||
|
updateFilename(p_id:String, p_name:String, p_filename:String):void
Updates the name field in an existing file descriptor.
| FileManager | ||
|
updateSubmitterID(p_id:String, p_submitterID:String):void
Updates the submitter field in an existing file descriptor.
| FileManager | ||
|
updateUploadProgress(p_id:String, p_uploadProgress:Number):void
Updates the
uploadProgress field in an existing file descriptor. | FileManager | ||
| Event | Summary | Defined by | ||
|---|---|---|---|---|
Dispatched when a fileDescriptor is retracted from the service,
and its corresponding file has been deleted. | FileManager | |||
| Dispatched when the my role with respect to a stream changes. | FileManager | |||
Dispatched when a new fileDescriptor is sent to the service. | FileManager | |||
| Dispatched when a user's request to upload has been validated. | FileManager | |||
| Dispatched when the manager goes in and out of sync either on connect or disconnect. | FileManager | |||
Dispatched when a fileDescriptor has been updated. | FileManager | |||
| Dispatched when the user's role with respect to a stream changes. | FileManager | |||
| Constant | Defined by | ||
|---|---|---|---|
| COLLECTION_NAME : String = "FileManager" [static]
The name of the CollectionNode used to represent the FileManager's shared model.
| FileManager | ||
| amIUploadingFile | property |
amIUploadingFile:Boolean [read-write]Specifies whether the current user is currently uploading a file. Note that only one file may be uploaded at a time.
Implementation public function get amIUploadingFile():Boolean
public function set amIUploadingFile(value:Boolean):void
| connectSession | property |
connectSession:IConnectSession [read-write](Read Only) Specifies the IConnectSession to which this manager is assigned.
Implementation public function get connectSession():IConnectSession
public function set connectSession(value:IConnectSession):void
| fileDescriptors | property |
public var fileDescriptors:ArrayCollection
The set of all fileDescriptors in the room.
| isSynchronized | property |
isSynchronized:Boolean [read-only]Returns true if the model is synchronized.
This property can be used as the source for data binding.
Implementation public function get isSynchronized():Boolean
| maxFileSize | property |
maxFileSize:Number [read-only]Specifies the maximum filesize allowed.
Implementation public function get maxFileSize():Number
| FileManager | () | constructor |
public function FileManager()Constructor.
| canIUpload | () | method |
public function canIUpload(p_groupName:String):BooleanIndicates whether or not the local client has upload privileges on the chosen group.
Parametersp_groupName:String |
Boolean — True if we can, false if not.
|
| clearFileDescriptor | () | method |
public function clearFileDescriptor(p_id:String):voidClears a file descriptor by retracting the file in question and thereby making it unavailable for download.
Parametersp_id:String — The ID of the file descriptor.
|
| createGroup | () | method |
public function createGroup(p_groupName:String, p_nodeConfiguration:NodeConfiguration = null):void
Creates a new group for files with the specified name and nodeConfiguration.
p_groupName:String — The name for the new group.
|
|
p_nodeConfiguration:NodeConfiguration (default = null) — The settings for the new group; most notably, accessModel
and publishModel for rights.
|
| findGroupFor | () | method |
public function findGroupFor(p_id:String):StringReturns the group name of which the indicated descriptor is a member.
Parametersp_id:String — The ID of the descriptor to look up.
|
String — The name of the group of which the indicated descriptor is a member.
|
| getFileDescriptor | () | method |
public function getFileDescriptor(p_id:String):FileDescriptorReturns a specific file descriptor.
Parametersp_id:String — The ID of the file descriptor.
|
FileDescriptor —
The filedescriptor.
|
| getFileDescriptors | () | method |
public function getFileDescriptors(p_groupName:String):ArrayCollection
Returns the set of fileDescriptors in a specified group.
p_groupName:String — The name of the group to query.
|
ArrayCollection — An ArrayCollection of FileDescriptors.
|
| getGroupNames | () | method |
public function getGroupNames():ArrayReturns all the group names.
ReturnsArray — An array of group names
|
| getNodeConfiguration | () | method |
public function getNodeConfiguration(p_groupName:String):NodeConfigurationGets the NodeConfiguration of a node within a group.
Parametersp_groupName:String — The group name for the node on which to get the node configuration. The default is null.
|
NodeConfiguration |
| getUserRole | () | method |
public function getUserRole(p_userID:String, p_groupName:String = null):intGets the role of the specified user for a particular group.
Parametersp_userID:String — The specified user's userID.
|
|
p_groupName:String (default = null) — The group name for which to get the user role. The default is null.
|
int — int which is the user role value
|
| isGroupDefined | () | method |
public function isGroupDefined(p_groupName:String):BooleanReturns whether or not a specified group exists.
Parametersp_groupName:String — The name of the group to query.
|
Boolean — True if the group exists; false if not.
|
| publishFileDescriptor | () | method |
public function publishFileDescriptor(p_descriptor:FileDescriptor, p_associatedUserID:String = null):void
Announces to the service that a file will be uploaded for the first time by the
local client or by somebody else. Only a host can request that someone else upload a file.
To specify this, set p_associatedUserID to another user's userID.
p_descriptor:FileDescriptor — The file descriptor to publish.
|
|
p_associatedUserID:String (default = null) — The ID of the intended uploader of the file.
|
| removeGroup | () | method |
public function removeGroup(p_groupName:String):voidRemoves a group if it does exist as well as the nodes associated with it.
Parametersp_groupName:String — The group Name.
|
| setNodeConfiguration | () | method |
public function setNodeConfiguration(p_nodeConf:NodeConfiguration, p_groupName:String):voidSets the NodeConfiguration of a node within a group.
Parametersp_nodeConf:NodeConfiguration — The group name for the node on which to set the node configuration. The default is null.
|
|
p_groupName:String |
| setUserRole | () | method |
public function setUserRole(p_userID:String, p_role:int, p_groupName:String):voidSets the specified user's role to the indicated role for the node. Only users with an owner role may call this method.
Parametersp_userID:String — The specified user's userID.
|
|
p_role:int — The role desired.
|
|
p_groupName:String — The group name for which the user role is being set. The default is null.
|
| updateFileDescriptor | () | method |
public function updateFileDescriptor(p_id:String, p_name:String = null, p_filename:String = null, p_url:String = null, p_type:String = null, p_size:int = -1, p_uploadProgress:Number = -1, p_state:String = null):void
Updates any field of a file descriptor except for its ID, submitterID,
and lastModified.
p_id:String — The ID of the descriptor to change.
|
|
p_name:String (default = null) — The new name (if null, no change).
|
|
p_filename:String (default = null) — The new filename (if null, no change).
|
|
p_url:String (default = null) — The new URL (if null, no change)
|
|
p_type:String (default = null) — The new type (if null, no change)
|
|
p_size:int (default = -1) — The new size (-1, no change)
|
|
p_uploadProgress:Number (default = -1) — The new uploadProgress (if -1, no change)
|
|
p_state:String (default = null) — The new state (one of the constants defined on FileDescriptor. If null, no change)
|
See also
| updateFilename | () | method |
public function updateFilename(p_id:String, p_name:String, p_filename:String):voidUpdates the name field in an existing file descriptor.
Parametersp_id:String — The ID of the file descriptor to change.
|
|
p_name:String — The new name.
|
|
p_filename:String — The new filename.
|
| updateSubmitterID | () | method |
public function updateSubmitterID(p_id:String, p_submitterID:String):voidUpdates the submitter field in an existing file descriptor. Only hosts can use this.
Parametersp_id:String — The ID of the file descriptor to change.
|
|
p_submitterID:String — The new submitter's ID.
|
| updateUploadProgress | () | method |
public function updateUploadProgress(p_id:String, p_uploadProgress:Number):void
Updates the uploadProgress field in an existing file descriptor.
p_id:String — The ID of the file descriptor to change.
|
|
p_uploadProgress:Number — The new upload progress percentage.
|
| clearedFileDescriptor | event |
com.adobe.rtc.events.FileManagerEvent
Dispatched when a fileDescriptor is retracted from the service,
and its corresponding file has been deleted.
| myRoleChange | event |
com.adobe.rtc.events.CollectionNodeEvent
Dispatched when the my role with respect to a stream changes.
| newFileDescriptor | event |
com.adobe.rtc.events.FileManagerEvent
Dispatched when a new fileDescriptor is sent to the service. Note that this doesn't
indicate that a file has been uploaded but rather that a user has begun uploading a file.
| readyForUpload | event |
com.adobe.rtc.events.FileManagerEvent
Dispatched when a user's request to upload has been validated.
| synchronizationChange | event |
com.adobe.rtc.events.CollectionNodeEvent
Dispatched when the manager goes in and out of sync either on connect or disconnect.
| updatedFileDescriptor | event |
com.adobe.rtc.events.FileManagerEvent
Dispatched when a fileDescriptor has been updated. This may mean any of
the properties on the FileDescriptor has changed. If the uploadProgress is 100, the
file is ready for download.
| userRoleChange | event |
com.adobe.rtc.events.CollectionNodeEvent
Dispatched when the user's role with respect to a stream changes.
| COLLECTION_NAME | constant |
public static const COLLECTION_NAME:String = "FileManager"The name of the CollectionNode used to represent the FileManager's shared model.
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/labs/acrobatcom/com/adobe/rtc/sharedManagers/FileManager.html