
11
SERVER-SIDE ACTIONSCRIPT LANGUAGE REFERENCE FOR ADOBE MEDIA SERVER 5.0.1
Server-Side ActionScript Language Reference
Last updated 7/2/2013
Returns
A boolean value of true if the shared object at the specified path was deleted; otherwise, false. If wildcard characters
are used to delete multiple files, the method returns
true only if all the shared objects that match the wildcard pattern
were successfully deleted; otherwise, it returns
false.
Example
The following example clears all the shared objects for an instance:
function onApplicationStop(){
application.clearSharedObjects("/");
}
application.clearStreams()
application.clearStreams(streamPath)
Clears recorded streams files associated with an application instance. You can use this method to clear a single stream,
all streams associated with the application instance, just those streams in a specific subdirectory of the application
instance, or just those streams whose names match a specified wildcard pattern.
If the clearStreams() method is invoked on a stream that is currently recording, the recorded file is set to length 0
(cleared), and the internal cached data is also cleared.
A call to application.clearStreams() invokes the Stream.onStatus() handler and passes it an information
object that contains information about the success or failure of the call.
Note: You can also use the Administration API removeApp() method to delete all the resources for a single application
instance.
Availability
Flash Communication Server 1
Parameters
streamPath A string indicating the Uniform Resource Identifier (URI) of a stream.
The streamPath parameter specifies the location and name of a stream relative to the directory of the application
instance. You can include a slash (/) as a delimiter between directories in the path. The last element in the path can
contain wildcard patterns (for example, a question mark [?] and an asterisk [*]) or a stream name. The
clearStreams() method traverses the stream hierarchy along the specified path and clears all the recorded streams
that match the given wildcard pattern. Specifying a slash clears all the streams that are associated with an application
instance.
To clear FLV, F4V, or MP3 files, precede the stream path with flv:, mp4:, or mp3:. When you specify flv: or mp3:
you don’t have to specify a file extension; .flv and .mp3 are implied. However, when you call
application.clearStreams("mp4:foo"), the server deletes any file with the name “foo” in an MPEG-4 container;
for example, foo.mp4, foo.mov, and foo.f4v. To delete a specific file, pass the file extension in the call; for example,
application.clearStreams("mp4:foo.f4v").
Note: If you don't precede the stream path with a file type, only FLV files are deleted.
The following examples show some possible values for the streamPath parameter:
• flv:/ clears all FLV streams associated with the application instance.
• mp3:/ clears all MP3 files associated with the application instance.
Komentarze do niniejszej Instrukcji