
56
SERVER-SIDE ACTIONSCRIPT LANGUAGE REFERENCE FOR ADOBE MEDIA SERVER 5.0.1
Server-Side ActionScript Language Reference
Last updated 7/2/2013
By default, a script can access files and directories only within the application directory of the hosting application. A
server administrator can grant access to additional directories by specifying virtual directory mappings for File object
paths. This is done in the
FileObject tag in the Application.xml file, as shown in the following example:
<FileObject>
<VirtualDirectory>/videos;C:\myvideos</VirtualDirectory>
<VirtualDirectory>/amsapps;C:\Program Files\ams\applications</VirtualDirectory>
</FileObject>
This example specifies two additional directory mappings in addition to the default application directory. Any path
that begins with /videos—for example, /videos/xyz/vacation.flv—maps to c:/myvideos/xyz/vaction.flv. Similarly,
/amsapps/conference maps to c:/Program Files/ams/applications/conference. Any path that does not match a
mapping resolves to the default application folder. For example, if c:/myapps/filetest is the application directory, then
/streams/hello.flv maps to c:/myapps/filetest/streams/hello.flv.
Note: You can use an Application.xml file at the virtual host level or at the application level.
In addition, the following rules are enforced by the server:
• File objects cannot be created by using native file path specification.
• File object paths must follow the URI convention:
A slash (/) must be used as the path separator. Access is denied if a path contains a backslash (\), or if a dot (.) or
two dots (..) is the only string component found between path separators.
• Root objects cannot be renamed or deleted.
For example, if a path using a slash (/) is used to create a File object, the application folder is mapped.
Availability
Flash Media Server 2
Property summary
Property Description
File.canAppend Read-only; a boolean value indicating whether a file can be appended (true) or not (false).
File.canRead Read-only; A boolean value indicating whether a file can be read (true) or not (false).
File.canReplace Read-only; A boolean value indicating whether a file was opened in "create" mode (true) or not (false).
This property is undefined for closed files.
File.canWrite Read-only; a boolean value indicating whether a file can be written to (true) or not (false).
File.creationTime Read-only; a Date object containing the time the file was created.
File.exists Read-only; a boolean value indicating whether the file or directory exists (true) or not (false).
File.isDirectory Read-only; a boolean value indicating whether the file is a directory (true) or not (false).
File.isFile Read-only; a boolean value indicating whether the file is a regular data file (true) or not (false).
File.isOpen Read-only; a boolean value indicating whether the file has been successfully opened and is still open (true) or
not (
false).
File.lastModified Read-only; a Date object containing the time the file was last modified.
File.length Read-only; for a directory, the number of files in the directory, not counting the current directory and parent
directory entries; for a file, the number of bytes in the file.
File.mode Read-only; the mode of an open file.
Kommentare zu diesen Handbüchern