Packagecom.adobe.flascc.vfs
Classpublic class DefaultVFS
InheritanceDefaultVFS Inheritance Object
Implements IVFS

The default implementation of the IVFS interface



Public Properties
 PropertyDefined By
  console : ISpecialFile
Set the console for the filesystem.
DefaultVFS
Public Methods
 MethodDefined By
  
The default implementation of the IVFS interface
DefaultVFS
  
addBackingStore(bs:IBackingStore, prefix:String):void
Mounts a backing store as part of the VFS.
DefaultVFS
  
addDirectory(path:String):void
Adds an empty directory to the filesystem.
DefaultVFS
  
addFile(path:String, data:ByteArray):void
Adds a file to the filesystem.
DefaultVFS
  
addSpecialFile(path:String, specialFile:ISpecialFile):void
Add a special file to the filesystem.
DefaultVFS
  
checkPath(path:String):String
Checks a proposed path for a new file.
DefaultVFS
  
closeFile(fileDescriptor:int):void
Closes a file.
DefaultVFS
  
deleteFile(path:String):void
Deletes a file (or directory) from the filesystem.
DefaultVFS
  
getDirectoryEntries(dirpath:String):Vector.<FileHandle>
Retrieves the contents of a directory.
DefaultVFS
  
Looks up the FileHandle instance for a file descriptor.
DefaultVFS
  
Resolves a path to a file.
DefaultVFS
  
isValidFileDescriptor(fileDescriptor:int):Boolean
Determines whether the argument is a valid file descriptor.
DefaultVFS
  
openFile(fileHandle:FileHandle, fileDescriptor:int = -1):int
Opens a file and assigns it a file descriptor.
DefaultVFS
Property Detail
consoleproperty
console:ISpecialFile

Set the console for the filesystem. This associates the file "/dev/tty" with the console object. When the applications writes to stdout and stderr, the console object will be called back.


Implementation
    public function get console():ISpecialFile
    public function set console(value:ISpecialFile):void
Constructor Detail
DefaultVFS()Constructor
public function DefaultVFS()

The default implementation of the IVFS interface

Method Detail
addBackingStore()method
public function addBackingStore(bs:IBackingStore, prefix:String):void

Mounts a backing store as part of the VFS. Once this method returns, files contained within the backing store will be available to the application.

Parameters

bs:IBackingStore — The backing store containing the files to add.
 
prefix:String — The path to the mount point for this backing store. This must be an empty directory.

addDirectory()method 
public function addDirectory(path:String):void

Adds an empty directory to the filesystem. The directory must not already exist.

Parameters

path:String — The absolute path to the directory to be added.

addFile()method 
public function addFile(path:String, data:ByteArray):void

Adds a file to the filesystem. The file must not already exist.

Parameters

path:String — The absolute path to the file to be added.
 
data:ByteArray — The contents of the file.

addSpecialFile()method 
public function addSpecialFile(path:String, specialFile:ISpecialFile):void

Add a special file to the filesystem. Special files are different from regular files in that they don't have any stored contents. Instead calls to read and write for a special file are routed to a callback object. Special files are never persisted across different runs of the application.

Parameters

path:String — The absolute path to the special file.
 
specialFile:ISpecialFile — The callback object for the file.

checkPath()method 
public function checkPath(path:String):String

Checks a proposed path for a new file.

Parameters

path:String — The absolute path to the file.

Returns
String — A CheckPathResult describing any problems with the proposed file name, if any.
closeFile()method 
public function closeFile(fileDescriptor:int):void

Closes a file. Once this method returns, the file descriptor is no longer valid.

Parameters

fileDescriptor:int — A file descriptor returned from openFile.

deleteFile()method 
public function deleteFile(path:String):void

Deletes a file (or directory) from the filesystem. The file must exist, and if it is a directory, it must be empty.

Parameters

path:String — The absolute path to the file to be deleted.

getDirectoryEntries()method 
public function getDirectoryEntries(dirpath:String):Vector.<FileHandle>

Retrieves the contents of a directory.

Parameters

dirpath:String — The absolute path to the directory.

Returns
Vector.<FileHandle> — A Vector of FileHandles, one per file in the directory, or null if the directory does not exist.
getFileHandleFromFileDescriptor()method 
public function getFileHandleFromFileDescriptor(fileDescriptor:int):FileHandle

Looks up the FileHandle instance for a file descriptor.

Parameters

fileDescriptor:int — A file descriptor.

Returns
FileHandle — The FileHandle corresponding to the file descriptor, or null if the file descriptor is not valid.
getFileHandleFromPath()method 
public function getFileHandleFromPath(path:String):FileHandle

Resolves a path to a file.

Parameters

path:String — The absolute path to the file.

Returns
FileHandle — An FileHandle instance for the file, or null if the file does not exist.
isValidFileDescriptor()method 
public function isValidFileDescriptor(fileDescriptor:int):Boolean

Determines whether the argument is a valid file descriptor.

Parameters

fileDescriptor:int — A integer that may or may not be a file descriptor.

Returns
Boolean — true if the file descriptor is a valid file descriptor corresponding to an open file, false otherwise.
openFile()method 
public function openFile(fileHandle:FileHandle, fileDescriptor:int = -1):int

Opens a file and assigns it a file descriptor. A file descriptor is a non-negative integer, which remains valid until closeFile is called.

Parameters

fileHandle:FileHandle — A FileHandle instance for the file to be opened.
 
fileDescriptor:int (default = -1) — If specified, the file descriptor to assign. Must not already be a valid file descriptor.

Returns
int — The file descriptor assigned to this file.