Examples of IStreamFilenameGenerator


Examples of org.red5.server.api.stream.IStreamFilenameGenerator

  /** {@inheritDoc} */
  public void saveAs(String name, boolean isAppend) throws IOException, ResourceNotFoundException, ResourceExistException {
    try {
      IScope scope = getScope();
      IStreamFilenameGenerator generator = (IStreamFilenameGenerator) ScopeUtils.getScopeService(scope, IStreamFilenameGenerator.class, DefaultStreamFilenameGenerator.class);

      String filename = generator.generateFilename(scope, name, ".flv", GenerationType.RECORD);
      Resource res = scope.getContext().getResource(filename);
      if (!isAppend) {
        if (res.exists()) {
          // Per livedoc of FCS/FMS:
          // When "live" or "record" is used,
View Full Code Here

Examples of org.red5.server.api.stream.IStreamFilenameGenerator

   * @param name
   * @return file
   */
  public static File getRecordFile(IScope scope, String name) {
    // get stream filename generator
    IStreamFilenameGenerator generator = (IStreamFilenameGenerator) ScopeUtils.getScopeService(scope, IStreamFilenameGenerator.class, DefaultStreamFilenameGenerator.class);
    // generate filename
    String fileName = generator.generateFilename(scope, name, ".flv", GenerationType.RECORD);
    File file = null;
    if (generator.resolvesToAbsolutePath()) {
      file = new File(fileName);
    } else {
      Resource resource = scope.getContext().getResource(fileName);
      if (resource.exists()) {
        try {
View Full Code Here

Examples of org.red5.server.api.stream.IStreamFilenameGenerator

        name = service.prepareFilename(name);
        break;
      }
    }
    // look for a custom filename gen class
    IStreamFilenameGenerator filenameGenerator = (IStreamFilenameGenerator) ScopeUtils.getScopeService(scope, IStreamFilenameGenerator.class,
        DefaultStreamFilenameGenerator.class);
    // get the filename
    String filename = filenameGenerator.generateFilename(scope, name, GenerationType.PLAYBACK);
    File file;
    try {
      // most likely case first
      if (!filenameGenerator.resolvesToAbsolutePath()) {
        try {
          file = scope.getContext().getResource(filename).getFile();
        } catch (FileNotFoundException e) {
          log.debug("File {} not found, nulling it", filename);
          file = null;
View Full Code Here

Examples of org.red5.server.api.stream.IStreamFilenameGenerator

        name = service.prepareFilename(name);
        break;
      }
    }

    IStreamFilenameGenerator filenameGenerator = (IStreamFilenameGenerator) ScopeUtils.getScopeService(scope, IStreamFilenameGenerator.class, ExternalStreamFilenameGenerator.class);

    String filename = filenameGenerator.generateFilename(scope, name, GenerationType.PLAYBACK);
    File file;
    if (filenameGenerator.resolvesToAbsolutePath()) {
      file = new File(filename);
    } else {
      file = scope.getContext().getResource(filename).getFile();
    }
    return file;
View Full Code Here

Examples of org.red5.server.api.stream.IStreamFilenameGenerator

      // TODO: throw other exception here?
      throw new IOException("stream is no longer connected");
    }
    IScope scope = conn.getScope();
    // Get stream filename generator
    IStreamFilenameGenerator generator = (IStreamFilenameGenerator) ScopeUtils
        .getScopeService(scope, IStreamFilenameGenerator.class,
            DefaultStreamFilenameGenerator.class);

    // Generate filename
    String filename = generator.generateFilename(scope, name, ".flv",
        GenerationType.RECORD);
    // Get file for that filename
    File file;
    if (generator.resolvesToAbsolutePath()) {
      file = new File(filename);
    } else {
      file = scope.getContext().getResource(filename).getFile();
    }
    // If append mode is on...
View Full Code Here

Examples of org.red5.server.api.stream.IStreamFilenameGenerator

  /** {@inheritDoc} */
  public void saveAs(String name, boolean isAppend) throws IOException,
      ResourceNotFoundException, ResourceExistException {
    try {
    IScope scope = getScope();
    IStreamFilenameGenerator generator = (IStreamFilenameGenerator) ScopeUtils
    .getScopeService(scope, IStreamFilenameGenerator.class,
        DefaultStreamFilenameGenerator.class);
   
    String filename = generator.generateFilename(scope, name, ".flv", GenerationType.RECORD);
    // Get file for that filename
    File file;
    if (generator.resolvesToAbsolutePath()) {
      file = new File(filename);
    } else {
      file = scope.getContext().getResource(filename).getFile();
    }
    if (!isAppend) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.