Class DefaultStreamFilenameGenerator

java.lang.Object
org.red5.server.stream.DefaultStreamFilenameGenerator
All Implemented Interfaces:
IScopeService, IStreamFilenameGenerator

public class DefaultStreamFilenameGenerator extends Object implements 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)
  • Constructor Details

    • DefaultStreamFilenameGenerator

      public DefaultStreamFilenameGenerator()
  • Method Details

    • getStreamDirectory

      private String getStreamDirectory(IScope scope)
      Generate stream directory based on relative scope path. The base directory is
       streams
       
      , 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 interface IStreamFilenameGenerator
      Parameters:
      scope - Scope to use
      name - Stream name
      type - 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 interface IStreamFilenameGenerator
      Parameters:
      scope - Scope to use
      name - Stream filename
      extension - Extension
      type - 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 return
       false
       
      .
      Specified by:
      resolvesToAbsolutePath in interface IStreamFilenameGenerator
      Returns:
      always
       false