Package org.red5.server.stream
Class DefaultStreamFilenameGenerator
java.lang.Object
org.red5.server.stream.DefaultStreamFilenameGenerator
- All Implemented Interfaces:
IScopeService
,IStreamFilenameGenerator
Default filename generator for streams. The files will be stored in a directory "streams" in the application folder. Option for changing directory streams are saved to is investigated as of 0.6RC1.
- Author:
- The Red5 Project, Joachim Bauch (bauch@struktur.de)
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.red5.server.api.stream.IStreamFilenameGenerator
IStreamFilenameGenerator.GenerationType
-
Field Summary
Fields inherited from interface org.red5.server.api.stream.IStreamFilenameGenerator
BEAN_NAME
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongenerateFilename
(IScope scope, String name, String extension, IStreamFilenameGenerator.GenerationType type, String subFolder) Generate a filename with an extension.generateFilename
(IScope scope, String name, IStreamFilenameGenerator.GenerationType type) Generate a filename without an extension.private String
getStreamDirectory
(IScope scope) Generate stream directory based on relative scope path.boolean
The default filenames are relative to the scope path, so always return
-
Constructor Details
-
DefaultStreamFilenameGenerator
public DefaultStreamFilenameGenerator()
-
-
Method Details
-
getStreamDirectory
Generate stream directory based on relative scope path. The base directory isstreams
, e.g. a scope/application/one/two/
will generate a directory/streams/one/two/
inside the application.- Parameters:
scope
- Scope- Returns:
- Directory based on relative scope path
-
generateFilename
public String generateFilename(IScope scope, String name, IStreamFilenameGenerator.GenerationType type) Generate a filename without an extension.- Specified by:
generateFilename
in interfaceIStreamFilenameGenerator
- Parameters:
scope
- Scope to usename
- Stream nametype
- Generation strategy (either playback or record)- Returns:
- Full filename
-
generateFilename
public String generateFilename(IScope scope, String name, String extension, IStreamFilenameGenerator.GenerationType type, String subFolder) Generate a filename with an extension.- Specified by:
generateFilename
in interfaceIStreamFilenameGenerator
- Parameters:
scope
- Scope to usename
- Stream filenameextension
- Extensiontype
- Generation strategy (either playback or record)- Returns:
- Full filename with extension
-
resolvesToAbsolutePath
public boolean resolvesToAbsolutePath()The default filenames are relative to the scope path, so always returnfalse
.- Specified by:
resolvesToAbsolutePath
in interfaceIStreamFilenameGenerator
- Returns:
- always
false
-