store(buffer, metadata, options = {}) {
    let streamOptions = {};
    if (options.encoding) {
      streamOptions.encoding = options.encoding;
    }
    return new Bluebird((resolve, reject) => {
      try {
        this._securityCheck(metadata.location);
      } catch(e) {
        return Bluebird.reject(e);
      }
      const stream = createWriteStream(metadata.location, {});
      stream.on('finish', resolve);
      stream.on('error', reject);
      if (options.isStream) {
        buffer.pipe(stream);
      }
      if (options.isStream) {
        buffer.pipe(stream);
      } else {
        stream.write(buffer);
        stream.end();
      }
    });
  }
/**
   * Store the given buffer to a local file using given metadata
   * @param buffer<Buffer|Stream>
   * @param metadata<object>
   * @param options<object> can have 'encoding' and 'isStream' member
   * @returns {Promise<any>}
   */
Store the given buffer to a local file using given metadata
@param buffer
@param metadata
@param options can have 'encoding' and 'isStream' member
@returns {Promise}
Store the given buffer to a local file using given metadata @param buffer @param metadata @param options can have ' encoding ' and ' isStream ' member @returns { Promise }
store(buffer, metadata, options = {}) {
    let streamOptions = {};
    if (options.encoding) {
      streamOptions.encoding = options.encoding;
    }
    return new Bluebird((resolve, reject) => {
      try {
        this._securityCheck(metadata.location);
      } catch(e) {
        return Bluebird.reject(e);
      }
      const stream = createWriteStream(metadata.location, {});
      stream.on('finish', resolve);
      stream.on('error', reject);
      if (options.isStream) {
        buffer.pipe(stream);
      }
      if (options.isStream) {
        buffer.pipe(stream);
      } else {
        stream.write(buffer);
        stream.end();
      }
    });
  }
store ( buffer , metadata , options = { } ) { let streamOptions = { } ; if ( options . encoding ) { streamOptions . encoding = options . encoding ; } return new Bluebird ( ( resolve , reject ) => { try { this . _securityCheck ( metadata . location ) ; } catch ( e ) { return Bluebird . reject ( e ) ; } const stream = createWriteStream ( metadata . location , { } ) ; stream . on ( 'finish' , resolve ) ; stream . on ( 'error' , reject ) ; if ( options . isStream ) { buffer . pipe ( stream ) ; } if ( options . isStream ) { buffer . pipe ( stream ) ; } else { stream . write ( buffer ) ; stream . end ( ) ; } } ) ; }
Store the given buffer to a local file using given metadata
 @param buffer<Buffer|Stream>
 @param metadata<object>
 @param options<object> can have 'encoding' and 'isStream' member
 @returns {Promise<any>}
Store the given buffer to a local file using given metadata @param buffer<Buffer|Stream > @param metadata<object > @param options<object > can have ' encoding ' and ' isStream ' member @returns { Promise<any > }