Interface IStreamFilenameGenerator

All Superinterfaces:
IScopeService
All Known Implementing Classes:
DefaultStreamFilenameGenerator

public interface IStreamFilenameGenerator extends IScopeService
A class that can generate filenames for streams.
Author:
The Red5 Project, Joachim Bauch (bauch@struktur.de)
  • Field Details

    • BEAN_NAME

      static final String BEAN_NAME
      Name of the bean to setup a custom filename generator in an application.
      See Also:
  • Method Details

    • generateFilename

      String generateFilename(IScope scope, String name, IStreamFilenameGenerator.GenerationType type)
      Generate a filename without an extension.
      Parameters:
      scope - Scope to use
      name - Stream name
      type - Generation strategy (either playback or record)
      Returns:
      Full filename
    • generateFilename

      String generateFilename(IScope scope, String name, String extension, IStreamFilenameGenerator.GenerationType type, String subFolder)
      Generate a filename with an extension.
      Parameters:
      scope - Scope to use
      name - Stream filename
      extension - Extension
      type - Generation strategy (either playback or record)
      Returns:
      Full filename with extension
    • resolvesToAbsolutePath

      boolean resolvesToAbsolutePath()
      True if returned filename is an absolute path, else relative to application. If relative to application, you need to use
       scope.getContext().getResources(fileName)[0].getFile()
       
      to resolve this to a file. If absolute (ie returns true) simply use
       new File(generateFilename(scope, name))
       
      Returns:
      true if an absolute path; else false