Examples of IStreamableFileFactory


Examples of org.red5.io.IStreamableFileFactory

     */

    private void init() throws IOException {

   
    IStreamableFileFactory factory = (IStreamableFileFactory) ScopeUtils

        .getScopeService(scope, IStreamableFileFactory.class,

            StreamableFileFactory.class);

    File folder = file.getParentFile();

    if (!folder.exists()) {

      if (!folder.mkdirs()) {

        throw new IOException("Could not create parent folder");

      }

    }

    if (!file.isFile()) {

      // Maybe the (previously existing) file has been deleted

      file.createNewFile();

    } else if (!file.canWrite()) {

      throw new IOException("The file is read-only");

    }

    IStreamableFileService service = factory.getService(file);

    IStreamableFile flv = service.getStreamableFile(file);

    writer = flv.getWriter();

View Full Code Here

Examples of org.red5.io.IStreamableFileFactory

     *
     * @throws IOException          I/O exception
     */
    protected void init() throws IOException {

    IStreamableFileFactory factory = (IStreamableFileFactory) ScopeUtils
        .getScopeService(this.scope, IStreamableFileFactory.class,
            StreamableFileFactory.class);
   
    File folder = file.getParentFile();

    if (!folder.exists()) {
      if (!folder.mkdirs()) {
        throw new IOException("Could not create parent folder");
      }
    }

    if (!this.file.isFile()) {

      // Maybe the (previously existing) file has been deleted
      this.file.createNewFile();

    } else if (!file.canWrite()) {
      throw new IOException("The file is read-only");
    }

    IStreamableFileService service = factory.getService(this.file);
    IStreamableFile flv = service.getStreamableFile(this.file);
    this.writer = flv.getWriter();

  }
View Full Code Here

Examples of org.red5.io.IStreamableFileFactory

   *             I/O exception
   */
  private void init() throws IOException {
    file = new File(OmFileHelper.getStreamsSubDir(this.scope.getName()), this.streamName + ".flv");

    IStreamableFileFactory factory = (IStreamableFileFactory) ScopeUtils
        .getScopeService(this.scope, IStreamableFileFactory.class,
            StreamableFileFactory.class);

    if (!this.file.isFile()) {
      // Maybe the (previously existing) file has been deleted
      this.file.createNewFile();

    } else if (!file.canWrite()) {
      throw new IOException("The file is read-only");
    }

    IStreamableFileService service = factory.getService(this.file);
    IStreamableFile flv = service.getStreamableFile(this.file);
    this.writer = flv.getWriter();

  }
View Full Code Here

Examples of org.red5.io.IStreamableFileFactory

   *             I/O exception
   */
  private void init() throws IOException {
    file = new File(OmFileHelper.getStreamsSubDir(scope.getName()), streamName + ".flv");

    IStreamableFileFactory factory = (IStreamableFileFactory) ScopeUtils.getScopeService(scope, IStreamableFileFactory.class,
        StreamableFileFactory.class);

    if (!file.isFile()) {
      // Maybe the (previously existing) file has been deleted
      file.createNewFile();

    } else if (!file.canWrite()) {
      throw new IOException("The file is read-only");
    }

    IStreamableFileService service = factory.getService(file);
    IStreamableFile flv = service.getStreamableFile(file);
    writer = flv.getWriter();
  }
View Full Code Here

Examples of org.red5.io.IStreamableFileFactory

     * Initialization
     *
     * @throws IOException          I/O exception
     */
    private void init() throws IOException {
    IStreamableFileFactory factory = (IStreamableFileFactory) ScopeUtils
        .getScopeService(scope, IStreamableFileFactory.class,
            StreamableFileFactory.class);
    File folder = file.getParentFile();
    if (!folder.exists())
      if (!folder.mkdirs())
        throw new IOException("can't create parent folder");
    if (!file.isFile()) {
      // Maybe the (previously existing) file has been deleted
      file.createNewFile();
    } else if (!file.canWrite()) {
      throw new IOException("the file is read-only");
    }
    IStreamableFileService service = factory.getService(file);
    IStreamableFile flv = service.getStreamableFile(file);
    if (mode == null || mode.equals(IClientStream.MODE_RECORD)) {
      writer = flv.getWriter();
    } else if (mode.equals(IClientStream.MODE_APPEND)) {
      writer = flv.getAppendWriter();
View Full Code Here

Examples of org.red5.io.IStreamableFileFactory

    }
    return status;
  }

  private File getStreamFile(IScope scope, String name) throws IOException {
    IStreamableFileFactory factory = (IStreamableFileFactory) ScopeUtils
        .getScopeService(scope, IStreamableFileFactory.class);
    if (name.indexOf(':') == -1 && name.indexOf('.') == -1) {
      // Default to .flv files if no prefix and no extension is given.
      name = "flv:" + name;
    }
    log.info("getStreamFile null check - factory: " + factory + " name: "
        + name);
    for (IStreamableFileService service : factory.getServices()) {
      if (name.startsWith(service.getPrefix() + ':')) {
        name = service.prepareFilename(name);
        break;
      }
    }
View Full Code Here

Examples of org.red5.io.IStreamableFileFactory

    /**
     * Initializes file provider. Creates streamable file factory and service, seeks to start position
     */
    private void init() throws IOException {
    IStreamableFileFactory factory = (IStreamableFileFactory) ScopeUtils
        .getScopeService(scope, IStreamableFileFactory.class,
            StreamableFileFactory.class);
    IStreamableFileService service = factory.getService(file);
    if (service == null) {
      log.error("No service found for " + file.getAbsolutePath());
      return;
    }
    IStreamableFile streamFile = service.getStreamableFile(file);
View Full Code Here

Examples of org.red5.io.IStreamableFileFactory

      return 0;
    }

    double duration = 0;

    IStreamableFileFactory factory = (IStreamableFileFactory) ScopeUtils
        .getScopeService(scope, IStreamableFileFactory.class,
            StreamableFileFactory.class);
    IStreamableFileService service = factory.getService(file);
    if (service == null) {
      log.error("No service found for {}", file.getAbsolutePath());
      return 0;
    }
    try {
View Full Code Here

Examples of org.red5.io.IStreamableFileFactory

   *             I/O exception
   */
  private void init() throws IOException {
    file = new File(OmFileHelper.getStreamsSubDir(scope.getName()), streamName + ".flv");

    IStreamableFileFactory factory = (IStreamableFileFactory) ScopeUtils.getScopeService(scope, IStreamableFileFactory.class,
        StreamableFileFactory.class);

    if (!file.isFile()) {
      // Maybe the (previously existing) file has been deleted
      file.createNewFile();

    } else if (!file.canWrite()) {
      throw new IOException("The file is read-only");
    }

    IStreamableFileService service = factory.getService(file);
    IStreamableFile flv = service.getStreamableFile(file);
    writer = flv.getWriter();
  }
View Full Code Here

Examples of org.red5.io.IStreamableFileFactory

        + this.scope.getName() + File.separatorChar + this.streamName
        + ".flv";

    file = new File(flvName);

    IStreamableFileFactory factory = (IStreamableFileFactory) ScopeUtils
        .getScopeService(this.scope, IStreamableFileFactory.class,
            StreamableFileFactory.class);

    // File folder = file.getParentFile();

    if (!folder.exists()) {
      if (!folder.mkdirs()) {
        throw new IOException("Could not create parent folder");
      }
    }

    if (!this.file.isFile()) {

      // Maybe the (previously existing) file has been deleted
      this.file.createNewFile();

    } else if (!file.canWrite()) {
      throw new IOException("The file is read-only");
    }

    IStreamableFileService service = factory.getService(this.file);
    IStreamableFile flv = service.getStreamableFile(this.file);
    this.writer = flv.getWriter();

  }
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.